mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 20:33:49 -04:00
staging: r8188eu: remove rtw_buf_free() function
It is just a wrapper around kfree(), so just replace all calls with kfree() instead. The pointer is also set to NULL and the length set to 0 to emulate the original logic, just to be "safe" as I do not have a device to test with, but odds are that can be removed later on. Link: https://lore.kernel.org/r/20210730092417.1014392-8-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -102,8 +102,12 @@ 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);
|
||||
pmlmepriv->assoc_req = NULL;
|
||||
pmlmepriv->assoc_req_len = 0;
|
||||
kfree(&pmlmepriv->assoc_rsp);
|
||||
pmlmepriv->assoc_rsp = NULL;
|
||||
pmlmepriv->assoc_rsp_len = 0;
|
||||
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);
|
||||
|
||||
@@ -1522,7 +1522,9 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
|
||||
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);
|
||||
kfree(&pmlmepriv->assoc_rsp);
|
||||
pmlmepriv->assoc_rsp = NULL;
|
||||
pmlmepriv->assoc_rsp_len = 0;
|
||||
}
|
||||
|
||||
report_join_res(padapter, res);
|
||||
@@ -5549,8 +5551,11 @@ void issue_assocreq(struct adapter *padapter)
|
||||
exit:
|
||||
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);
|
||||
else {
|
||||
kfree(&pmlmepriv->assoc_req);
|
||||
pmlmepriv->assoc_req = NULL;
|
||||
pmlmepriv->assoc_req_len = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -440,7 +440,6 @@ u64 rtw_division64(u64 x, u64 y);
|
||||
(((u64) (a)[3]) << 24) | (((u64) (a)[2]) << 16) | \
|
||||
(((u64) (a)[1]) << 8) | ((u64) (a)[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 {
|
||||
|
||||
@@ -388,13 +388,6 @@ u64 rtw_division64(u64 x, u64 y)
|
||||
return x;
|
||||
}
|
||||
|
||||
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 ori_len = 0, dup_len = 0;
|
||||
|
||||
Reference in New Issue
Block a user