Commit ff3f9503 authored by David Gibson's avatar David Gibson Committed by David S. Miller

[IPV4]: Initialize newly allocated hash tables in fib_semantics.c

When fib_create_info() allocates new hash tables, it neglects to
initialize them.  This leads to an oops during boot on at least
machine I use.  This patch addresses the problem.
Signed-off-by: default avatarDavid Gibson <dwg@au1.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7eb241f4
...@@ -604,8 +604,12 @@ fib_create_info(const struct rtmsg *r, struct kern_rta *rta, ...@@ -604,8 +604,12 @@ fib_create_info(const struct rtmsg *r, struct kern_rta *rta,
if (!new_info_hash || !new_laddrhash) { if (!new_info_hash || !new_laddrhash) {
fib_hash_free(new_info_hash, bytes); fib_hash_free(new_info_hash, bytes);
fib_hash_free(new_laddrhash, bytes); fib_hash_free(new_laddrhash, bytes);
} else } else {
memset(new_info_hash, 0, bytes);
memset(new_laddrhash, 0, bytes);
fib_hash_move(new_info_hash, new_laddrhash, new_size); fib_hash_move(new_info_hash, new_laddrhash, new_size);
}
if (!fib_hash_size) if (!fib_hash_size)
goto failure; goto failure;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment