]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] TG3: Add missing unlock in tg3_open() error path.
authorIra W. Snyder <kernel@irasnyder.com>
Wed, 22 Nov 2006 02:59:09 +0000 (02:59 +0000)
committerChris Wright <chrisw@sous-sol.org>
Sat, 2 Dec 2006 00:12:37 +0000 (16:12 -0800)
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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/net/tg3.c

index eafabb253f08d244585e8be5e74164586c111f91..fa620aeb7731569f22c25721492168b8dbdc481c 100644 (file)
@@ -6889,8 +6889,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;