igb: fix null pointer dereference seen with fiber NICs
authorAlexander Duyck <alexander.h.duyck@intel.com>
Mon, 4 Aug 2008 21:59:46 +0000 (14:59 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 7 Aug 2008 05:55:05 +0000 (01:55 -0400)
With a fiber or serdes NIC installed the driver was causing a null pointer
dereference on driver unload.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/igb/igb_main.c

index f23a0487bf13e16a2966e8f7cc4ba8c504d45e53..cfed2b07f3a4a041f048b9e7cec1fcd0ec538924 100644 (file)
@@ -1372,7 +1372,8 @@ static void __devexit igb_remove(struct pci_dev *pdev)
 
        unregister_netdev(netdev);
 
-       if (!igb_check_reset_block(&adapter->hw))
+       if (adapter->hw.phy.ops.reset_phy &&
+           !igb_check_reset_block(&adapter->hw))
                adapter->hw.phy.ops.reset_phy(&adapter->hw);
 
        igb_remove_device(&adapter->hw);