IPoIB: fix error handling in ipoib_open
authorRoland Dreier <rolandd@cisco.com>
Tue, 29 Nov 2005 18:55:58 +0000 (10:55 -0800)
committerRoland Dreier <rolandd@cisco.com>
Tue, 29 Nov 2005 18:55:58 +0000 (10:55 -0800)
If ipoib_ib_dev_up() fails after ipoib_ib_dev_open() is called, then
ipoib_ib_dev_stop() needs to be called to clean up.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib_main.c

index 826d7a73ef8481c3834f69554cadf3d7ff3d26c3..475d98fa9e26645c2b76b001d08bbea0fc6d12a7 100644 (file)
@@ -94,8 +94,10 @@ int ipoib_open(struct net_device *dev)
        if (ipoib_ib_dev_open(dev))
                return -EINVAL;
 
-       if (ipoib_ib_dev_up(dev))
+       if (ipoib_ib_dev_up(dev)) {
+               ipoib_ib_dev_stop(dev);
                return -EINVAL;
+       }
 
        if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
                struct ipoib_dev_priv *cpriv;