]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tg3: negate USE_PHYLIB flag check
authorJiri Pirko <jpirko@redhat.com>
Tue, 11 Oct 2011 23:00:41 +0000 (23:00 +0000)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 8 Dec 2011 19:18:02 +0000 (11:18 -0800)
[ Upstream commit e730c82347b9dc75914da998c44c3f348965db41 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/tg3.c

index 135c8b7690e43914ca823b2f69d5640ee1e81bf1..27722fd6d4e9781e7558329139e35e66ca935592 100644 (file)
@@ -15285,7 +15285,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
 
                cancel_work_sync(&tp->reset_task);
 
-               if (!tg3_flag(tp, USE_PHYLIB)) {
+               if (tg3_flag(tp, USE_PHYLIB)) {
                        tg3_phy_fini(tp);
                        tg3_mdio_fini(tp);
                }