[ewg] [PATCH] ipoib: clear IPOIB_FLAG_ADMIN_UP if ipoib_open fails
Yossi Etigin
yosefe at voltaire.com
Wed Apr 22 11:19:28 PDT 2009
If ipoib_open() fails, it should clear IPOIB_FLAG_ADMIN_UP bit and not
leave if on.
This is already fixed in 2.6.30.
Reported-by: Jack Morgenstein <jackm at dev.mellanox.co.il>
Signed-off-by: Yossi Etigin <yosefe at voltaire.com>
---
Index: b/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c 2009-04-22 19:45:11.000000000 +0300
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c 2009-04-22 19:51:51.000000000 +0300
@@ -112,11 +112,11 @@ int ipoib_open(struct net_device *dev)
return 0;
if (ipoib_ib_dev_open(dev))
- return -EINVAL;
+ goto err;
if (ipoib_ib_dev_up(dev)) {
ipoib_ib_dev_stop(dev, 1);
- return -EINVAL;
+ goto err;
}
if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
@@ -139,6 +139,9 @@ int ipoib_open(struct net_device *dev)
netif_start_queue(dev);
return 0;
+err:
+ clear_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags);
+ return -EINVAL;
}
static int ipoib_stop(struct net_device *dev)
More information about the ewg
mailing list