Skip to content

Commit

Permalink
[TG3]: Add missing unlock in tg3_open() error path.
Browse files Browse the repository at this point in the history
Sparse noticed a locking imbalance in tg3_open(). This patch adds an
unlock to one of the error paths, so that tg3_open() always exits
without the lock held.

Signed-off-by: Ira W. Snyder <kernel@irasnyder.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ira W. Snyder authored and David S. Miller committed Nov 22, 2006
1 parent f2776ff commit 1286208
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -6979,8 +6979,10 @@ static int tg3_open(struct net_device *dev)
tg3_full_lock(tp, 0);

err = tg3_set_power_state(tp, PCI_D0);
if (err)
if (err) {
tg3_full_unlock(tp);
return err;
}

tg3_disable_ints(tp);
tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
Expand Down

0 comments on commit 1286208

Please sign in to comment.