[ofa-general] [PATCH] ipoib - possible memory leak

Eli Cohen eli at mellanox.co.il
Tue Aug 21 08:46:10 PDT 2007


Fix cleanup in case of failure - prevent memory
leak in case of failure to query pkey ot gid.

Signed-off-by: Eli Cohen <eli at mellnaox.co.il>

---

Index: linux-2.6.23-rc1/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- linux-2.6.23-rc1.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c	2007-08-21 18:25:07.000000000 +0300
+++ linux-2.6.23-rc1/drivers/infiniband/ulp/ipoib/ipoib_main.c	2007-08-21 18:38:34.000000000 +0300
@@ -1083,7 +1083,7 @@ static struct net_device *ipoib_add_port
 	if (result) {
 		printk(KERN_WARNING "%s: ib_query_pkey port %d failed (ret = %d)\n",
 		       hca->name, port, result);
-		goto alloc_mem_failed;
+		goto device_init_failed;
 	}
 
 	/*
@@ -1099,7 +1099,7 @@ static struct net_device *ipoib_add_port
 	if (result) {
 		printk(KERN_WARNING "%s: ib_query_gid port %d failed (ret = %d)\n",
 		       hca->name, port, result);
-		goto alloc_mem_failed;
+		goto device_init_failed;
 	} else
 		memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid));
 




More information about the general mailing list