From fbeb0dab5e6c3013d176a9070ffa8a1eb250d5f1 Mon Sep 17 00:00:00 2001 From: Shraddha Barke Date: Mon, 12 Oct 2015 20:49:20 +0530 Subject: [PATCH] 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 --- drivers/staging/wilc1000/linux_wlan.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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)