mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
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: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cccfc39e5c
commit
fbeb0dab5e
1 changed files with 2 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue