netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wireless: remove unnecessary condition check before kfree
@ 2018-09-08 14:12 zhong jiang
  2018-09-10  7:10 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: zhong jiang @ 2018-09-08 14:12 UTC (permalink / raw)
  To: davem, johannes; +Cc: linux-wireless, netdev, linux-kernel

kfree has taken the null pointer into account. Just remove the
redundant condition check before kfree.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/wireless/reg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5ad5b9f..dc87e3d 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1086,7 +1086,7 @@ int reg_reload_regdb(void)
 	}
 
 	rtnl_lock();
-	if (!IS_ERR_OR_NULL(regdb))
+	if (!IS_ERR(regdb))
 		kfree(regdb);
 	regdb = db;
 	rtnl_unlock();
@@ -3920,7 +3920,7 @@ void regulatory_exit(void)
 		kfree(reg_request);
 	}
 
-	if (!IS_ERR_OR_NULL(regdb))
+	if (!IS_ERR(regdb))
 		kfree(regdb);
 
 	free_regdb_keyring();
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-10 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-08 14:12 [PATCH] wireless: remove unnecessary condition check before kfree zhong jiang
2018-09-10  7:10 ` Johannes Berg
2018-09-10 13:54   ` zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).