kfree has taken the null pointer into account. Just remove the redundant condition check before kfree. Signed-off-by: zhong jiang <zhongjiang@xxxxxxxxxx> --- 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