aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smc911x.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2007-02-03 04:13:50 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-03 14:26:06 -0500
commit24d8f6aded45aca87dec6d9c037b75b189e3d731 (patch)
tree5702797c937772e8d45011ed7287a265479191cb /drivers/net/smc911x.c
parent29a002776ba5ef170446910b1f93c480cdd43706 (diff)
[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)
968 * We should not be called if phy_type is zero. 968 * We should not be called if phy_type is zero.
969 */ 969 */
970 if (lp->phy_type == 0) 970 if (lp->phy_type == 0)
971 goto smc911x_phy_configure_exit; 971 goto smc911x_phy_configure_exit_nolock;
972 972
973 if (smc911x_phy_reset(dev, phyaddr)) { 973 if (smc911x_phy_reset(dev, phyaddr)) {
974 printk("%s: PHY reset timed out\n", dev->name); 974 printk("%s: PHY reset timed out\n", dev->name);
975 goto smc911x_phy_configure_exit; 975 goto smc911x_phy_configure_exit_nolock;
976 } 976 }
977 spin_lock_irqsave(&lp->lock, flags); 977 spin_lock_irqsave(&lp->lock, flags);
978 978
@@ -1041,6 +1041,7 @@ static void smc911x_phy_configure(struct work_struct *work)
1041 1041
1042smc911x_phy_configure_exit: 1042smc911x_phy_configure_exit:
1043 spin_unlock_irqrestore(&lp->lock, flags); 1043 spin_unlock_irqrestore(&lp->lock, flags);
1044smc911x_phy_configure_exit_nolock:
1044 lp->work_pending = 0; 1045 lp->work_pending = 0;
1045} 1046}
1046 1047