From 7e901dcd73d73230ad0e66e35fb6f1da244e41f7 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sun, 13 Mar 2011 00:29:06 -0500 Subject: [PATCH] staging: rtl8192e: Remove NULL check before kfree This patch was generated by the following semantic patch: // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // Signed-off-by: Ilia Mirkin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/ieee80211/ieee80211_module.c | 7 ++----- drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c | 7 ++----- drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c | 7 ++----- drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c | 1 - 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c index 67bcd41e66b1..663b0b8e1095 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c @@ -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); diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c index e2eac7cadf4f..57acb3f21adf 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c @@ -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-- diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c index fc96676bb9ce..8d73a7313766 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c @@ -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); diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c index cac340e5238a..bb0ff26bd843 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c @@ -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; -- 2.20.1