From: Raphaël Beamonte Date: Tue, 18 Aug 2015 16:58:13 +0000 (-0400) Subject: staging: rtl8192u: r8192U_core: fix unnecessary check before kfree code style issue X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=efe8a7fad59f4e157485e91d84210fe7496afa03;p=deliverable%2Flinux.git staging: rtl8192u: r8192U_core: fix unnecessary check before kfree code style issue kfree(NULL) is safe and the checks were not required. Signed-off-by: Raphaël Beamonte Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index cd14c0a680da..d0020f1caa26 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1724,10 +1724,9 @@ static void rtl8192_usb_deleteendpoints(struct net_device *dev) } kfree(priv->oldaddr); priv->oldaddr = NULL; - if (priv->pp_rxskb) { - kfree(priv->pp_rxskb); - priv->pp_rxskb = NULL; - } + + kfree(priv->pp_rxskb); + priv->pp_rxskb = NULL; } #else void rtl8192_usb_deleteendpoints(struct net_device *dev) @@ -1752,11 +1751,9 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev) priv->rx_urb = NULL; kfree(priv->oldaddr); priv->oldaddr = NULL; - if (priv->pp_rxskb) { - kfree(priv->pp_rxskb); - priv->pp_rxskb = 0; - } + kfree(priv->pp_rxskb); + priv->pp_rxskb = 0; #endif }