mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
staging: rtl8188eu: core: Remove null check before kfree
kfree on NULL pointer is a no-op.
This patch uses the following semantic patch to find such an instance
where NULL check is present before kfree.
// <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>
Build tested it.
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7ede7af3fd
commit
a055b3cbb7
1 changed files with 1 additions and 2 deletions
|
|
@ -433,8 +433,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
|||
|
||||
psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
|
||||
if (psecnetwork == NULL) {
|
||||
if (pcmd != NULL)
|
||||
kfree(pcmd);
|
||||
kfree(pcmd);
|
||||
|
||||
res = _FAIL;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue