浏览代码

[PATCH] net/smc911x: match up spin lock/unlock

smc911x_phy_configure's error handling unconditionally unlocks the
spinlock even if it wasn't locked. Patch fixes it.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Peter Korsgaard 18 年之前
父节点
当前提交
24d8f6aded
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      drivers/net/smc911x.c

+ 3 - 2
drivers/net/smc911x.c

@@ -968,11 +968,11 @@ static void smc911x_phy_configure(struct work_struct *work)
 	 * We should not be called if phy_type is zero.
 	 * We should not be called if phy_type is zero.
 	 */
 	 */
 	if (lp->phy_type == 0)
 	if (lp->phy_type == 0)
-		 goto smc911x_phy_configure_exit;
+		 goto smc911x_phy_configure_exit_nolock;
 
 
 	if (smc911x_phy_reset(dev, phyaddr)) {
 	if (smc911x_phy_reset(dev, phyaddr)) {
 		printk("%s: PHY reset timed out\n", dev->name);
 		printk("%s: PHY reset timed out\n", dev->name);
-		goto smc911x_phy_configure_exit;
+		goto smc911x_phy_configure_exit_nolock;
 	}
 	}
 	spin_lock_irqsave(&lp->lock, flags);
 	spin_lock_irqsave(&lp->lock, flags);
 
 
@@ -1041,6 +1041,7 @@ static void smc911x_phy_configure(struct work_struct *work)
 
 
 smc911x_phy_configure_exit:
 smc911x_phy_configure_exit:
 	spin_unlock_irqrestore(&lp->lock, flags);
 	spin_unlock_irqrestore(&lp->lock, flags);
+smc911x_phy_configure_exit_nolock:
 	lp->work_pending = 0;
 	lp->work_pending = 0;
 }
 }