diff options
Diffstat (limited to 'drivers/net/ntb_netdev.c')
-rw-r--r-- | drivers/net/ntb_netdev.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c index f3cdf64..8298880 100644 --- a/drivers/net/ntb_netdev.c +++ b/drivers/net/ntb_netdev.c @@ -367,12 +367,15 @@ static void ntb_netdev_remove(struct pci_dev *pdev) { struct net_device *ndev; struct ntb_netdev *dev; + bool found = false; list_for_each_entry(dev, &dev_list, list) { - if (dev->pdev == pdev) + if (dev->pdev == pdev) { + found = true; break; + } } - if (dev == NULL) + if (!found) return; list_del(&dev->list); |