IPoIB: Fix leak in ipoib_transport_dev_init() error path
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Mon, 6 Aug 2007 14:09:09 +0000 (17:09 +0300)
committerRoland Dreier <rolandd@cisco.com>
Tue, 7 Aug 2007 19:40:56 +0000 (12:40 -0700)
ipoib_transport_dev_init() calls ipoib_cm_dev_init(), so it needs to
call ipoib_cm_dev_cleanup() to unwind that on the error path.

Found by Dotan Barak of Mellanox.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib_verbs.c

index 982eb88e27ec0f2451ac4ee5ced6bc72e47e7129..563aeacf9e14088cc9054030f418d4c0bf717756 100644 (file)
@@ -211,6 +211,7 @@ out_free_cq:
 
 out_free_mr:
        ib_dereg_mr(priv->mr);
+       ipoib_cm_dev_cleanup(dev);
 
 out_free_pd:
        ib_dealloc_pd(priv->pd);