diff options
author | MichelleJin <shjy180909@gmail.com> | 2021-09-27 03:34:56 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-28 12:59:24 +0100 |
commit | f04ed7d277e842af9934b71b529341d1ba31a9c1 (patch) | |
tree | e0695fe17ed7959bd8b007e694ffe1cc65dcbd27 /net/ipv6/seg6_hmac.c | |
parent | d7cade513752968d894d4d73e0b08fe2d84d6d4b (diff) | |
download | lwn-f04ed7d277e842af9934b71b529341d1ba31a9c1.tar.gz lwn-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/seg6_hmac.c')
-rw-r--r-- | net/ipv6/seg6_hmac.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c index 687d95dce085..29bc4e7c3046 100644 --- a/net/ipv6/seg6_hmac.c +++ b/net/ipv6/seg6_hmac.c @@ -405,9 +405,7 @@ int __net_init seg6_hmac_net_init(struct net *net) { struct seg6_pernet_data *sdata = seg6_pernet(net); - rhashtable_init(&sdata->hmac_infos, &rht_params); - - return 0; + return rhashtable_init(&sdata->hmac_infos, &rht_params); } EXPORT_SYMBOL(seg6_hmac_net_init); |