diff options
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index c886b28ba9f5..e278cb9d0075 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -593,10 +593,13 @@ static void fib_hash_move(struct hlist_head *new_info_hash, | |||
593 | struct hlist_head *new_laddrhash, | 593 | struct hlist_head *new_laddrhash, |
594 | unsigned int new_size) | 594 | unsigned int new_size) |
595 | { | 595 | { |
596 | struct hlist_head *old_info_hash, *old_laddrhash; | ||
596 | unsigned int old_size = fib_hash_size; | 597 | unsigned int old_size = fib_hash_size; |
597 | unsigned int i; | 598 | unsigned int i, bytes; |
598 | 599 | ||
599 | write_lock(&fib_info_lock); | 600 | write_lock(&fib_info_lock); |
601 | old_info_hash = fib_info_hash; | ||
602 | old_laddrhash = fib_info_laddrhash; | ||
600 | fib_hash_size = new_size; | 603 | fib_hash_size = new_size; |
601 | 604 | ||
602 | for (i = 0; i < old_size; i++) { | 605 | for (i = 0; i < old_size; i++) { |
@@ -636,6 +639,10 @@ static void fib_hash_move(struct hlist_head *new_info_hash, | |||
636 | fib_info_laddrhash = new_laddrhash; | 639 | fib_info_laddrhash = new_laddrhash; |
637 | 640 | ||
638 | write_unlock(&fib_info_lock); | 641 | write_unlock(&fib_info_lock); |
642 | |||
643 | bytes = old_size * sizeof(struct hlist_head *); | ||
644 | fib_hash_free(old_info_hash, bytes); | ||
645 | fib_hash_free(old_laddrhash, bytes); | ||
639 | } | 646 | } |
640 | 647 | ||
641 | struct fib_info * | 648 | struct fib_info * |