From: Shraddha Barke Date: Mon, 12 Oct 2015 15:19:20 +0000 (+0530) Subject: Staging: wilc1000: linux_wlan: Remove NULL check before kfree X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fbeb0dab5e6c3013d176a9070ffa8a1eb250d5f1;p=openwrt%2Fstaging%2Fblogic.git Staging: wilc1000: linux_wlan: Remove NULL check before kfree kfree on NULL pointer is a no-op. The semantic patch used - // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // smpl> Signed-off-by: Shraddha Barke Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index fe4f3051916d..ccab89f8b0cc 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1887,10 +1887,8 @@ static void __exit exit_wilc_driver(void) sdio_unregister_driver(&wilc_bus); #endif - if (g_linux_wlan != NULL) { - kfree(g_linux_wlan); - g_linux_wlan = NULL; - } + kfree(g_linux_wlan); + g_linux_wlan = NULL; printk("Module_exit Done.\n"); #if defined(WILC_DEBUGFS)