diff options
author | Aishwarya Pant | 2017-04-10 15:43:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2017-04-11 07:34:14 +0200 |
commit | 7ad61a386bb804ae562966ae23baf5f4deee014b (patch) | |
tree | 7d00a81a62b2484d826cc522210bbb1b04f2ae6c /drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | |
parent | staging: rtl8723bs: Add missing include <linux/of.h> to fix compile error (diff) | |
download | kernel-qcow2-linux-7ad61a386bb804ae562966ae23baf5f4deee014b.tar.gz kernel-qcow2-linux-7ad61a386bb804ae562966ae23baf5f4deee014b.tar.xz kernel-qcow2-linux-7ad61a386bb804ae562966ae23baf5f4deee014b.zip |
staging: rtl8723bs: remove null test before kfree
kfree(..) on a NULL pointer is a no-op; the null test here is redundant.
Detected by coccicheck.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs/os_dep/ioctl_linux.c')
-rw-r--r-- | drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index fe3c42a0da31..e11045f2a1b6 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -766,9 +766,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, exit: - if (pwep) { - kfree((u8 *)pwep); - } + kfree((u8 *)pwep); return ret; } @@ -926,7 +924,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie exit: - if (buf) kfree(buf); + kfree(buf); return ret; } @@ -2502,10 +2500,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, ret = wpa_set_encryption(dev, param, param_len); exit: - if (param) - { - kfree((u8 *)param); - } + kfree((u8 *)param); return ret; } @@ -4135,11 +4130,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } exit: - - if (pwep) - { - kfree((u8 *)pwep); - } + kfree((u8 *)pwep); return ret; @@ -5785,12 +5776,9 @@ static int rtw_ioctl_wext_private(struct net_device *dev, union iwreq_data *wrq_ } exit: - if (input) - kfree(input); - if (buffer) - kfree(buffer); - if (output) - kfree(output); + kfree(input); + kfree(buffer); + kfree(output); return err; } |