Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tg3: negate USE_PHYLIB flag check

USE_PHYLIB flag in tg3_remove_one() is being checked incorrectly. This
results tg3_phy_fini->phy_disconnect is never called and when tg3 module
is removed.

In my case this resulted in panics in phy_state_machine calling function
phydev->adjust_link.

So correct this check.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Acked-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jiri Pirko and committed by
David S. Miller
e730c823 d5123480

+1 -1
+1 -1
drivers/net/tg3.c
··· 15577 15577 15578 15578 cancel_work_sync(&tp->reset_task); 15579 15579 15580 - if (!tg3_flag(tp, USE_PHYLIB)) { 15580 + if (tg3_flag(tp, USE_PHYLIB)) { 15581 15581 tg3_phy_fini(tp); 15582 15582 tg3_mdio_fini(tp); 15583 15583 }