Skip to content

Commit

Permalink
[PATCH] net/smc911x: match up spin lock/unlock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Korsgaard authored and Linus Torvalds committed Feb 3, 2007
1 parent 29a0027 commit 24d8f6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/smc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 24d8f6a

Please sign in to comment.