]> Pileus Git - ~andy/linux/commitdiff
[PATCH] bonding: fix a locking bug in bond_release
authorJay Vosburgh <fubar@us.ibm.com>
Wed, 8 Feb 2006 05:17:22 +0000 (21:17 -0800)
committerJeff Garzik <jgarzik@pobox.com>
Fri, 17 Feb 2006 21:16:39 +0000 (16:16 -0500)
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: Stephen J. Bevan <stephen@dino.dnsalias.com>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/bonding/bond_main.c

index e0f51afec778ef00bc2d7ecf2c3e28bf454bd549..bcf9f17daf0d36944d5ec362de405e7be718ab08 100644 (file)
@@ -1581,6 +1581,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
                printk(KERN_INFO DRV_NAME
                       ": %s: %s not enslaved\n",
                       bond_dev->name, slave_dev->name);
+               write_unlock_bh(&bond->lock);
                return -EINVAL;
        }