Patchwork rndis_wlan: Remove redundant NULL check before kfree

login
register
mail settings
Submitter Syam Sidhardhan
Date Feb. 24, 2013, 10:05 p.m.
Message ID <1361743543-27912-1-git-send-email-s.syam@samsung.com>
Download mbox | patch
Permalink /patch/222798/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Syam Sidhardhan - Feb. 24, 2013, 10:05 p.m.
kfree on a NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
---
 drivers/net/wireless/rndis_wlan.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Jussi Kivilinna - Feb. 25, 2013, 10:02 a.m.
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>

Quoting Syam Sidhardhan <syamsidhardh@gmail.com>:

> kfree on a NULL pointer is a no-op.
>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> ---
>  drivers/net/wireless/rndis_wlan.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/rndis_wlan.c  
> b/drivers/net/wireless/rndis_wlan.c
> index 525fd75..5f66b4e 100644
> --- a/drivers/net/wireless/rndis_wlan.c
> +++ b/drivers/net/wireless/rndis_wlan.c
> @@ -2839,8 +2839,7 @@ static void rndis_wlan_do_link_up_work(struct  
> usbnet *usbdev)
>  	} else if (priv->infra_mode == NDIS_80211_INFRA_ADHOC)
>  		cfg80211_ibss_joined(usbdev->net, bssid, GFP_KERNEL);
>
> -	if (info != NULL)
> -		kfree(info);
> +	kfree(info);
>
>  	priv->connected = true;
>  	memcpy(priv->bssid, bssid, ETH_ALEN);
> --
> 1.7.9.5
>
>
>



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 525fd75..5f66b4e 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2839,8 +2839,7 @@  static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
 	} else if (priv->infra_mode == NDIS_80211_INFRA_ADHOC)
 		cfg80211_ibss_joined(usbdev->net, bssid, GFP_KERNEL);
 
-	if (info != NULL)
-		kfree(info);
+	kfree(info);
 
 	priv->connected = true;
 	memcpy(priv->bssid, bssid, ETH_ALEN);