kfree() can handle NULL pointers itself, so the check is unnecessary.

Signed-off-by: Joseph-Eugene Winzer <m...@openmailbox.org>
---
 drivers/staging/rtl8192u/r8192U_core.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 89b627f..34dc4af 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1803,10 +1803,8 @@ 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)
@@ -1831,11 +1829,8 @@ 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
 }
-- 
2.4.6

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to