vxge: check for card status before continuing in device close
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>
Wed, 1 Jul 2009 21:14:03 +0000 (21:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jul 2009 02:16:28 +0000 (19:16 -0700)
- Fixed the crash in rmmod after vpath open failed when trying to change mtu.
We should check for card status before continuing in device close.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxge/vxge-main.c

index fa4dbc89e2702388f75faac4cffbda837fd16a4c..dd2add1d7566c460599222ef157e8b0105ca5521 100644 (file)
@@ -2890,6 +2890,9 @@ int do_vxge_close(struct net_device *dev, int do_io)
        vdev = (struct vxgedev *)netdev_priv(dev);
        hldev = (struct __vxge_hw_device *) pci_get_drvdata(vdev->pdev);
 
+       if (unlikely(!is_vxge_card_up(vdev)))
+               return 0;
+
        /* If vxge_handle_crit_err task is executing,
         * wait till it completes. */
        while (test_and_set_bit(__VXGE_STATE_RESET_CARD, &vdev->state))