Commit 2dac96b3 authored by Nachammai Karuppiah's avatar Nachammai Karuppiah Committed by Greg Kroah-Hartman

staging: rtl8723bs: core: Remove typecast in call to kfree

Remove typecast in the call to kfree as it is not needed.
Issue found using the below coccinelle script with options -I and
--recursive-includes,

@@
type t1;
expression *e;
@@

-kfree((t1 *)e);
+kfree(e);
Signed-off-by: default avatarNachammai Karuppiah <nachukannan@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/1570565858-91737-1-git-send-email-nachukannan@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8fd1fe82
......@@ -1453,7 +1453,7 @@ u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
psetstakey_para = rtw_zmalloc(sizeof(struct set_stakey_parm));
if (psetstakey_para == NULL) {
kfree((u8 *)ph2c);
kfree(ph2c);
res = _FAIL;
goto exit;
}
......@@ -1496,7 +1496,7 @@ static int rtw_ap_set_key(
}
psetkeyparm = rtw_zmalloc(sizeof(struct setkey_parm));
if (psetkeyparm == NULL) {
kfree((unsigned char *)pcmd);
kfree(pcmd);
res = _FAIL;
goto exit;
}
......
......@@ -372,13 +372,13 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
if ((pcmd->cmdcode != _JoinBss_CMD_) &&
(pcmd->cmdcode != _CreateBss_CMD_)) {
/* free parmbuf in cmd_obj */
kfree((unsigned char *)pcmd->parmbuf);
kfree(pcmd->parmbuf);
}
if (pcmd->rsp != NULL) {
if (pcmd->rspsz != 0) {
/* free rsp in cmd_obj */
kfree((unsigned char *)pcmd->rsp);
kfree(pcmd->rsp);
}
}
......
......@@ -2207,7 +2207,7 @@ sint rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv)
psetauthparm = rtw_zmalloc(sizeof(struct setauth_parm));
if (psetauthparm == NULL) {
kfree((unsigned char *)pcmd);
kfree(pcmd);
res = _FAIL;
goto exit;
}
......@@ -2284,7 +2284,7 @@ sint rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, s
default:
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key:psecuritypriv->dot11PrivacyAlgrthm = %x (must be 1 or 2 or 4 or 5)\n", psecuritypriv->dot11PrivacyAlgrthm));
res = _FAIL;
kfree((unsigned char *)psetkeyparm);
kfree(psetkeyparm);
goto exit;
}
......@@ -2292,7 +2292,7 @@ sint rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, s
if (enqueue) {
pcmd = rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd == NULL) {
kfree((unsigned char *)psetkeyparm);
kfree(psetkeyparm);
res = _FAIL; /* try again */
goto exit;
}
......@@ -2308,7 +2308,7 @@ sint rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, s
res = rtw_enqueue_cmd(pcmdpriv, pcmd);
} else {
setkey_hdl(adapter, (u8 *)psetkeyparm);
kfree((u8 *) psetkeyparm);
kfree(psetkeyparm);
}
exit:
return res;
......
......@@ -1466,11 +1466,11 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
}
}
kfree((u8 *)bssid);
kfree(bssid);
return _SUCCESS;
_mismatch:
kfree((u8 *)bssid);
kfree(bssid);
if (pmlmepriv->NumOfBcnInfoChkFail == 0)
pmlmepriv->timeBcnInfoChkStart = jiffies;
......
......@@ -2212,7 +2212,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
hwxmits = pxmitpriv->hwxmits;
if (hwxmits)
kfree((u8 *)hwxmits);
kfree(hwxmits);
}
void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
......
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