mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
staging: rtl8192e: Remove NULL check before kfree
This patch was generated by the following semantic patch: // <smpl> @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // </smpl> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
76be349c00
commit
7e901dcd73
@ -195,11 +195,8 @@ void free_ieee80211(struct net_device *dev)
|
||||
{
|
||||
struct ieee80211_device *ieee = netdev_priv(dev);
|
||||
int i;
|
||||
if (ieee->pHTInfo != NULL)
|
||||
{
|
||||
kfree(ieee->pHTInfo);
|
||||
ieee->pHTInfo = NULL;
|
||||
}
|
||||
kfree(ieee->pHTInfo);
|
||||
ieee->pHTInfo = NULL;
|
||||
RemoveAllTS(ieee);
|
||||
ieee80211_softmac_free(ieee);
|
||||
del_timer_sync(&ieee->crypt_deinit_timer);
|
||||
|
@ -1411,11 +1411,8 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
|
||||
return 1;
|
||||
|
||||
rx_dropped:
|
||||
if (rxb != NULL)
|
||||
{
|
||||
kfree(rxb);
|
||||
rxb = NULL;
|
||||
}
|
||||
kfree(rxb);
|
||||
rxb = NULL;
|
||||
stats->rx_dropped++;
|
||||
|
||||
/* Returning 0 indicates to caller that we have not handled the SKB--
|
||||
|
@ -2818,11 +2818,8 @@ void ieee80211_softmac_free(struct ieee80211_device *ieee)
|
||||
{
|
||||
down(&ieee->wx_sem);
|
||||
#ifdef ENABLE_DOT11D
|
||||
if(NULL != ieee->pDot11dInfo)
|
||||
{
|
||||
kfree(ieee->pDot11dInfo);
|
||||
ieee->pDot11dInfo = NULL;
|
||||
}
|
||||
kfree(ieee->pDot11dInfo);
|
||||
ieee->pDot11dInfo = NULL;
|
||||
#endif
|
||||
del_timer_sync(&ieee->associate_timer);
|
||||
|
||||
|
@ -862,7 +862,6 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
|
||||
ieee->wpa_ie_len = len;
|
||||
}
|
||||
else{
|
||||
if (ieee->wpa_ie)
|
||||
kfree(ieee->wpa_ie);
|
||||
ieee->wpa_ie = NULL;
|
||||
ieee->wpa_ie_len = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user