diff options
author | MichelleJin <shjy180909@gmail.com> | 2021-09-27 05:34:56 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-28 13:59:24 +0200 |
commit | f04ed7d277e842af9934b71b529341d1ba31a9c1 (patch) | |
tree | e0695fe17ed7959bd8b007e694ffe1cc65dcbd27 /net/ipv6/ila | |
parent | net/mlx5e: check return value of rhashtable_init (diff) | |
download | linux-f04ed7d277e842af9934b71b529341d1ba31a9c1.tar.xz linux-f04ed7d277e842af9934b71b529341d1ba31a9c1.zip |
net: ipv6: check return value of rhashtable_init
When rhashtable_init() fails, it returns -EINVAL.
However, since error return value of rhashtable_init is not checked,
it can cause use of uninitialized pointers.
So, fix unhandled errors of rhashtable_init.
Signed-off-by: MichelleJin <shjy180909@gmail.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ila')
-rw-r--r-- | net/ipv6/ila/ila_xlat.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index a1ac0e3d8c60..47447f0241df 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c @@ -610,7 +610,11 @@ int ila_xlat_init_net(struct net *net) if (err) return err; - rhashtable_init(&ilan->xlat.rhash_table, &rht_params); + err = rhashtable_init(&ilan->xlat.rhash_table, &rht_params); + if (err) { + free_bucket_spinlocks(ilan->xlat.locks); + return err; + } return 0; } |