diff options
| author | Tapasweni Pathak <tapaswenipathak@gmail.com> | 2014-10-30 18:38:09 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-30 23:12:05 +0300 |
| commit | a055b3cbb72d2487938d3452c79e2a338088fbc1 (patch) | |
| tree | 1050228064897fc249a5c018a730163feaf39158 | |
| parent | 7ede7af3fd5f92966d328586f7f42b378fa17d83 (diff) | |
| download | linux-a055b3cbb72d2487938d3452c79e2a338088fbc1.tar.xz | |
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>
| -rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_cmd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 7731cdb72b22..dd24138d13b1 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -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; |
