Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ad61a38 authored by Aishwarya Pant's avatar Aishwarya Pant Committed by Greg Kroah-Hartman
Browse files

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: default avatarAishwarya Pant <aishpant@gmail.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9ddf6e34
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -995,7 +995,6 @@ if (1) {
		rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_USAGE, (u8 *)&efuse_usage);
	}

	if (efuseTbl)
	kfree(efuseTbl);
}

@@ -1128,7 +1127,6 @@ static void hal_ReadEFuse_BT(
	}

exit:
	if (efuseTbl)
	kfree(efuseTbl);
}

+2 −4
Original line number Diff line number Diff line
@@ -602,7 +602,6 @@ static s32 _sdio_local_read(
	if (!err)
		memcpy(pbuf, ptmpbuf, cnt);

	if (ptmpbuf)
	kfree(ptmpbuf);

	return err;
@@ -646,7 +645,6 @@ s32 sdio_local_read(
	if (!err)
		memcpy(pbuf, ptmpbuf, cnt);

	if (ptmpbuf)
	kfree(ptmpbuf);

	return err;
+2 −6
Original line number Diff line number Diff line
@@ -1170,10 +1170,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
	}

addkey_end:
	if (param)
	{
	kfree((u8 *)param);
	}

	return ret;

@@ -1968,7 +1965,6 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
		pairwise_cipher, padapter->securitypriv.ndisencryptstatus, padapter->securitypriv.ndisauthtype));

exit:
	if (buf)
	kfree(buf);
	if (ret)
		_clr_fwstate_(&padapter->mlmepriv, WIFI_UNDER_WPS);
+7 −19
Original line number Diff line number Diff line
@@ -766,9 +766,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,

exit:

	if (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);
	}

	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);
	}

	return ret;

@@ -5785,11 +5776,8 @@ 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);

	return err;
+2 −4
Original line number Diff line number Diff line
@@ -76,11 +76,9 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb

void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag)
{
	if (free_sz > 0) {
		if (pxmitbuf->pallocated_buf)
	if (free_sz > 0)
		kfree(pxmitbuf->pallocated_buf);
}
}

#define WMM_XMIT_THRESHOLD	(NR_XMITFRAME*2/5)