[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1536415955-33776-1-git-send-email-zhongjiang@huawei.com>
Date: Sat, 8 Sep 2018 22:12:35 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <davem@...emloft.net>, <johannes@...solutions.net>
CC: <linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] wireless: remove unnecessary condition check before kfree
kfree has taken the null pointer into account. Just remove the
redundant condition check before kfree.
Signed-off-by: zhong jiang <zhongjiang@...wei.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
Powered by blists - more mailing lists