Commit fbeb0dab authored by Shraddha Barke's avatar Shraddha Barke Committed by Greg Kroah-Hartman

Staging: wilc1000: linux_wlan: Remove NULL check before kfree

kfree on NULL pointer is a no-op.

The semantic patch used -

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>smpl>
Signed-off-by: default avatarShraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cccfc39e
...@@ -1887,10 +1887,8 @@ static void __exit exit_wilc_driver(void) ...@@ -1887,10 +1887,8 @@ static void __exit exit_wilc_driver(void)
sdio_unregister_driver(&wilc_bus); sdio_unregister_driver(&wilc_bus);
#endif #endif
if (g_linux_wlan != NULL) { kfree(g_linux_wlan);
kfree(g_linux_wlan); g_linux_wlan = NULL;
g_linux_wlan = NULL;
}
printk("Module_exit Done.\n"); printk("Module_exit Done.\n");
#if defined(WILC_DEBUGFS) #if defined(WILC_DEBUGFS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment