diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2017-02-25 15:38:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-27 03:32:57 +0100 |
commit | ca435407ba6655a0d63230818ffe7006d967dfe5 (patch) | |
tree | 715d4494ea64d0e6ab26518a0c1489ed0491a134 /lib/rhashtable.c | |
parent | net sched actions: do not overwrite status of action creation. (diff) | |
download | linux-ca435407ba6655a0d63230818ffe7006d967dfe5.tar.xz linux-ca435407ba6655a0d63230818ffe7006d967dfe5.zip |
rhashtable: Fix use before NULL check in bucket_table_free
Dan Carpenter reported a use before NULL check bug in the function
bucket_table_free. In fact we don't need the NULL check at all as
no caller can provide a NULL argument. So this patch fixes this by
simply removing it.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/rhashtable.c')
-rw-r--r-- | lib/rhashtable.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 172454e6b979..fac1a78afb39 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -146,9 +146,7 @@ static void bucket_table_free(const struct bucket_table *tbl) if (tbl->nest) nested_bucket_table_free(tbl); - if (tbl) - kvfree(tbl->locks); - + kvfree(tbl->locks); kvfree(tbl); } |