From: Jon Mason Date: Thu, 18 Apr 2013 20:36:43 +0000 (-0700) Subject: ntb_netdev: remove from list on exit X-Git-Tag: v3.9.4~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32c0e1fe6fe8a9992f582b60a4f15858add89fcb;p=thirdparty%2Fkernel%2Fstable.git ntb_netdev: remove from list on exit commit 904435cf76a9bdd5eb41b1c4e049d5a64f3a8400 upstream. The ntb_netdev device is not removed from the global list of devices upon device removal. If the device is re-added, the removal code would find the first instance and try to remove an already removed device. Signed-off-by: Jon Mason Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c index ed947dd76fbd1..f3cdf64997d60 100644 --- a/drivers/net/ntb_netdev.c +++ b/drivers/net/ntb_netdev.c @@ -375,6 +375,8 @@ static void ntb_netdev_remove(struct pci_dev *pdev) if (dev == NULL) return; + list_del(&dev->list); + ndev = dev->ndev; unregister_netdev(ndev);