summaryrefslogtreecommitdiff
path: root/drivers/net/smc911x.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2007-02-03 12:13:50 +0300
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-03 22:26:06 +0300
commit24d8f6aded45aca87dec6d9c037b75b189e3d731 (patch)
tree5702797c937772e8d45011ed7287a265479191cb /drivers/net/smc911x.c
parent29a002776ba5ef170446910b1f93c480cdd43706 (diff)
downloadlinux-24d8f6aded45aca87dec6d9c037b75b189e3d731.tar.xz
[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>
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r--drivers/net/smc911x.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 880d9fdd7c67..43af61438449 100644
--- a/drivers/net/smc911x.c
+++ b/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.
*/
if (lp->phy_type == 0)
- goto smc911x_phy_configure_exit;
+ goto smc911x_phy_configure_exit_nolock;
if (smc911x_phy_reset(dev, phyaddr)) {
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);
@@ -1041,6 +1041,7 @@ static void smc911x_phy_configure(struct work_struct *work)
smc911x_phy_configure_exit:
spin_unlock_irqrestore(&lp->lock, flags);
+smc911x_phy_configure_exit_nolock:
lp->work_pending = 0;
}