Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12862086 authored by Ira W. Snyder's avatar Ira W. Snyder Committed by David S. Miller
Browse files

[TG3]: Add missing unlock in tg3_open() error path.



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: default avatarIra W. Snyder <kernel@irasnyder.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f2776ff0
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -6979,8 +6979,10 @@ static int tg3_open(struct net_device *dev)
	tg3_full_lock(tp, 0);
	tg3_full_lock(tp, 0);


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


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