Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5e2a7b2 authored by Jay Vosburgh's avatar Jay Vosburgh Committed by Jeff Garzik
Browse files

[PATCH] bonding: fix a locking bug in bond_release



bond_release returns EINVAL without releasing the bond lock if the
slave device is not being bonded by the bond.  The following patch
ensures that the lock is released in this case.

Signed-off-by: default avatarStephen J. Bevan <stephen@dino.dnsalias.com>
Acked-by: default avatarJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 66cc5d5a
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1581,6 +1581,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
		printk(KERN_INFO DRV_NAME
		printk(KERN_INFO DRV_NAME
		       ": %s: %s not enslaved\n",
		       ": %s: %s not enslaved\n",
		       bond_dev->name, slave_dev->name);
		       bond_dev->name, slave_dev->name);
		write_unlock_bh(&bond->lock);
		return -EINVAL;
		return -EINVAL;
	}
	}