瀏覽代碼

[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: Stephen J. Bevan <stephen@dino.dnsalias.com>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Jay Vosburgh 19 年之前
父節點
當前提交
f5e2a7b22e
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/net/bonding/bond_main.c

+ 1 - 0
drivers/net/bonding/bond_main.c

@@ -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;
 	}