Commit 4d506758 authored by Himanshu Jha's avatar Himanshu Jha Committed by Greg Kroah-Hartman

staging: rtl8723bs: remove null check before kfree

Kfree on NULL pointer is a no-op and therefore checking is redundant.
Signed-off-by: default avatarHimanshu Jha <himanshujha199640@gmail.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3687994a
...@@ -4120,10 +4120,8 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, ...@@ -4120,10 +4120,8 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param,
ie_len = len-12-2;/* 12 = param header, 2:no packed */ ie_len = len-12-2;/* 12 = param header, 2:no packed */
if (pmlmepriv->wps_beacon_ie) { kfree(pmlmepriv->wps_beacon_ie);
kfree(pmlmepriv->wps_beacon_ie); pmlmepriv->wps_beacon_ie = NULL;
pmlmepriv->wps_beacon_ie = NULL;
}
if (ie_len>0) { if (ie_len>0) {
pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len); pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len);
...@@ -4160,10 +4158,8 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par ...@@ -4160,10 +4158,8 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par
ie_len = len-12-2;/* 12 = param header, 2:no packed */ ie_len = len-12-2;/* 12 = param header, 2:no packed */
if (pmlmepriv->wps_probe_resp_ie) { kfree(pmlmepriv->wps_probe_resp_ie);
kfree(pmlmepriv->wps_probe_resp_ie); pmlmepriv->wps_probe_resp_ie = NULL;
pmlmepriv->wps_probe_resp_ie = NULL;
}
if (ie_len>0) { if (ie_len>0) {
pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len); pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len);
...@@ -4195,10 +4191,8 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par ...@@ -4195,10 +4191,8 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par
ie_len = len-12-2;/* 12 = param header, 2:no packed */ ie_len = len-12-2;/* 12 = param header, 2:no packed */
if (pmlmepriv->wps_assoc_resp_ie) { kfree(pmlmepriv->wps_assoc_resp_ie);
kfree(pmlmepriv->wps_assoc_resp_ie); pmlmepriv->wps_assoc_resp_ie = NULL;
pmlmepriv->wps_assoc_resp_ie = NULL;
}
if (ie_len>0) { if (ie_len>0) {
pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len); pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment