[net-next-2.6,3/9] vxge: check for card status before continuing in device close

Message ID Pine.GSO.4.10.10907020313180.13763-100000@guinness
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Sreenivasa Honnur July 2, 2009, 7:14 a.m.
- 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>

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


diff -urpN patch_2/drivers/net/vxge/vxge-main.c patch_3/drivers/net/vxge/vxge-main.c
--- patch_2/drivers/net/vxge/vxge-main.c	2009-06-21 23:43:43.000000000 -0700
+++ patch_3/drivers/net/vxge/vxge-main.c	2009-06-21 23:50:01.000000000 -0700
@@ -2890,6 +2890,9 @@  int do_vxge_close(struct net_device *dev
 	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))