From ca435407ba6655a0d63230818ffe7006d967dfe5 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 25 Feb 2017 22:38:11 +0800 Subject: [PATCH] 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 Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- lib/rhashtable.c | 4 +--- 1 file changed, 1 insertion(+), 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); } -- GitLab