[openib-general] [PATCH] IPoIB: Eliminate NULL checks prior to calling kfree

Hal Rosenstock halr at voltaire.com
Wed Jul 13 05:24:53 PDT 2005


IPoIB: Eliminate NULL checks prior to calling kfree

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: ipoib_main.c
===================================================================
--- ipoib_main.c	(revision 2824)
+++ ipoib_main.c	(working copy)
@@ -780,15 +780,10 @@
 
 	ipoib_ib_dev_cleanup(dev);
 
-	if (priv->rx_ring) {
-		kfree(priv->rx_ring);
-		priv->rx_ring = NULL;
-	}
-
-	if (priv->tx_ring) {
-		kfree(priv->tx_ring);
-		priv->tx_ring = NULL;
-	}
+	kfree(priv->rx_ring);
+	priv->rx_ring = NULL;
+	kfree(priv->tx_ring);
+	priv->tx_ring = NULL;
 }
 
 static void ipoib_setup(struct net_device *dev)






More information about the general mailing list