All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8192U_core: Remove unnecessary check
@ 2015-03-28 20:53 Ioana Ciornei
  2015-03-28 21:01 ` [Outreachy kernel] " Julia Lawall
  2015-04-01 15:30 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Ioana Ciornei @ 2015-03-28 20:53 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Ioana Ciornei

Remove unnecessary check since kfree() handles NULL pointers fine.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
---
 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 8834c23..bce44ba 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1724,10 +1724,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)
@@ -1752,11 +1750,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
 }
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-01 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-28 20:53 [PATCH] staging: r8192U_core: Remove unnecessary check Ioana Ciornei
2015-03-28 21:01 ` [Outreachy kernel] " Julia Lawall
2015-03-28 21:07   ` Ioana Ciornei
2015-04-01 15:30 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.