staging: r8188eu: Remove rtw_buf_free()

This routine is just a wrapper around kfree(). The wrapper also sets
buffer length to 0, and the pointer to NULL. The length variable is in
the struct to be freed, thus setting it to zero is meaningless. Setting
the pointer to NULL is also not needed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210805183717.23007-6-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Larry Finger
2021-08-05 13:37:17 -05:00
committed by Greg Kroah-Hartman
parent 346d13128a
commit d48401b860
4 changed files with 6 additions and 15 deletions

View File

@@ -99,8 +99,8 @@ static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen)
void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
{
rtw_buf_free(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len);
rtw_buf_free(&pmlmepriv->assoc_rsp, &pmlmepriv->assoc_rsp_len);
kfree(pmlmepriv->assoc_req);
kfree(pmlmepriv->assoc_rsp);
rtw_free_mlme_ie_data(&pmlmepriv->wps_beacon_ie, &pmlmepriv->wps_beacon_ie_len);
rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_req_ie, &pmlmepriv->wps_probe_req_ie_len);
rtw_free_mlme_ie_data(&pmlmepriv->wps_probe_resp_ie, &pmlmepriv->wps_probe_resp_ie_len);

View File

@@ -1519,11 +1519,10 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
UpdateBrateTbl(padapter, pmlmeinfo->network.SupportedRates);
report_assoc_result:
if (res > 0) {
if (res > 0)
rtw_buf_update(&pmlmepriv->assoc_rsp, &pmlmepriv->assoc_rsp_len, pframe, pkt_len);
} else {
rtw_buf_free(&pmlmepriv->assoc_rsp, &pmlmepriv->assoc_rsp_len);
}
else
kfree(pmlmepriv->assoc_rsp);
report_join_res(padapter, res);
@@ -5534,7 +5533,7 @@ void issue_assocreq(struct adapter *padapter)
if (ret == _SUCCESS)
rtw_buf_update(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len, (u8 *)pwlanhdr, pattrib->pktlen);
else
rtw_buf_free(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len);
kfree(pmlmepriv->assoc_req);
}
/* when wait_ack is ture, this function shoule be called at process context */

View File

@@ -370,7 +370,6 @@ void rtw_free_netdev(struct net_device *netdev);
(a)[3] = (u8) (((u32) (val)) & 0xff); \
} while (0)
void rtw_buf_free(u8 **buf, u32 *buf_len);
void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len);
struct rtw_cbuf {

View File

@@ -283,13 +283,6 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
return -1;
}
void rtw_buf_free(u8 **buf, u32 *buf_len)
{
*buf_len = 0;
kfree(*buf);
*buf = NULL;
}
void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len)
{
u32 dup_len = 0;