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 <rolandd@cisco.com>
This commit is contained in:
parent
4f71055a45
commit
267ee88ed3
@ -94,8 +94,10 @@ int ipoib_open(struct net_device *dev)
|
|||||||
if (ipoib_ib_dev_open(dev))
|
if (ipoib_ib_dev_open(dev))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (ipoib_ib_dev_up(dev))
|
if (ipoib_ib_dev_up(dev)) {
|
||||||
|
ipoib_ib_dev_stop(dev);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
|
if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
|
||||||
struct ipoib_dev_priv *cpriv;
|
struct ipoib_dev_priv *cpriv;
|
||||||
|
Loading…
Reference in New Issue
Block a user