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

staging: rtl8723bs: os_dep: Remove typecast in kfree

Remove typecast in the call to kfree as it is not needed.
Issue found using the below coccinelle script,

@@
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/1570511353-64646-1-git-send-email-nachukannan@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c6785558
...@@ -165,7 +165,7 @@ static void rtw_spt_band_free(struct ieee80211_supported_band *spt_band) ...@@ -165,7 +165,7 @@ static void rtw_spt_band_free(struct ieee80211_supported_band *spt_band)
+ sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM + sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM
+ sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM; + sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM;
} }
kfree((u8 *)spt_band); kfree(spt_band);
} }
static const struct ieee80211_txrx_stypes static const struct ieee80211_txrx_stypes
...@@ -1156,7 +1156,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -1156,7 +1156,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
} }
addkey_end: addkey_end:
kfree((u8 *)param); kfree(param);
return ret; return ret;
...@@ -2193,7 +2193,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2193,7 +2193,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
ret = -EOPNOTSUPP ; ret = -EOPNOTSUPP ;
} }
kfree((u8 *)pwep); kfree(pwep);
if (ret < 0) if (ret < 0)
goto exit; goto exit;
...@@ -2646,7 +2646,7 @@ static int rtw_cfg80211_add_monitor_if (struct adapter *padapter, char *name, st ...@@ -2646,7 +2646,7 @@ static int rtw_cfg80211_add_monitor_if (struct adapter *padapter, char *name, st
out: out:
if (ret && mon_wdev) { if (ret && mon_wdev) {
kfree((u8 *)mon_wdev); kfree(mon_wdev);
mon_wdev = NULL; mon_wdev = NULL;
} }
...@@ -3502,7 +3502,7 @@ void rtw_wdev_free(struct wireless_dev *wdev) ...@@ -3502,7 +3502,7 @@ void rtw_wdev_free(struct wireless_dev *wdev)
wiphy_free(wdev->wiphy); wiphy_free(wdev->wiphy);
kfree((u8 *)wdev); kfree(wdev);
} }
void rtw_wdev_unregister(struct wireless_dev *wdev) void rtw_wdev_unregister(struct wireless_dev *wdev)
......
...@@ -1142,7 +1142,7 @@ void rtw_ndev_destructor(struct net_device *ndev) ...@@ -1142,7 +1142,7 @@ void rtw_ndev_destructor(struct net_device *ndev)
DBG_871X(FUNC_NDEV_FMT "\n", FUNC_NDEV_ARG(ndev)); DBG_871X(FUNC_NDEV_FMT "\n", FUNC_NDEV_ARG(ndev));
if (ndev->ieee80211_ptr) if (ndev->ieee80211_ptr)
kfree((u8 *)ndev->ieee80211_ptr); kfree(ndev->ieee80211_ptr);
} }
void rtw_dev_unload(struct adapter *padapter) void rtw_dev_unload(struct adapter *padapter)
......
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