Skip to content

Commit 267ee88

Browse files
author
Roland Dreier
committed
IPoIB: fix error handling in ipoib_open
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 <[email protected]>
1 parent 4f71055 commit 267ee88

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ int ipoib_open(struct net_device *dev)
9494
if (ipoib_ib_dev_open(dev))
9595
return -EINVAL;
9696

97-
if (ipoib_ib_dev_up(dev))
97+
if (ipoib_ib_dev_up(dev)) {
98+
ipoib_ib_dev_stop(dev);
9899
return -EINVAL;
100+
}
99101

100102
if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
101103
struct ipoib_dev_priv *cpriv;

0 commit comments

Comments
 (0)