diff options
author | Shreeya Patel <shreeya.patel23498@gmail.com> | 2017-12-20 00:37:45 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-21 18:22:07 +0100 |
commit | 37edc1ccc9e1b61cbcfa8cc6bab463cba397bbe2 (patch) | |
tree | ceba517fd390bde53629b088e0265add788015dc /drivers/staging/rtl8723bs | |
parent | 16e1b4ebfbc27a15fabaad64a2d3344360654c9c (diff) | |
download | linux-stable-37edc1ccc9e1b61cbcfa8cc6bab463cba397bbe2.tar.gz linux-stable-37edc1ccc9e1b61cbcfa8cc6bab463cba397bbe2.tar.bz2 linux-stable-37edc1ccc9e1b61cbcfa8cc6bab463cba397bbe2.zip |
Staging: rtl8723bs: Do not check for NOT NULL before kfree()
Do not check for NOT NULL before calling kfree because
if the pointer is NULL, no action occurs.
Done using the following semantic patch by coccinelle.
@@
expression ptr;
@@
- if (ptr != NULL)
kfree(ptr);
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs')
-rw-r--r-- | drivers/staging/rtl8723bs/core/rtw_cmd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 9ac2dea6dff1..af0a9e0a00df 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -846,9 +846,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; RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd :psecnetwork == NULL!!!\n")); |