DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] kni: fix crash for KNI interface remove
@ 2016-08-31 13:06 Ferruh Yigit
  2016-09-09 13:46 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Ferruh Yigit @ 2016-08-31 13:06 UTC (permalink / raw)
  To: dev

Removing KNI interface that has no PCI driver for ethtool support cause
kernel crash.

Fixes: 109febfe58f9 ("net/igb: move PCI device IDs from EAL")
Fixes: 221fba3b987c ("net/ixgbe: move PCI device IDs from EAL")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/kni/kni_misc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
index 41a331f..acb961f 100644
--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -355,10 +355,12 @@ kni_dev_remove(struct kni_dev *dev)
 	if (!dev)
 		return -ENODEV;
 
-	if (pci_match_id(ixgbe_pci_tbl, dev->pci_dev))
-		ixgbe_kni_remove(dev->pci_dev);
-	else if (pci_match_id(igb_pci_tbl, dev->pci_dev))
-		igb_kni_remove(dev->pci_dev);
+	if (dev->pci_dev) {
+		if (pci_match_id(ixgbe_pci_tbl, dev->pci_dev))
+			ixgbe_kni_remove(dev->pci_dev);
+		else if (pci_match_id(igb_pci_tbl, dev->pci_dev))
+			igb_kni_remove(dev->pci_dev);
+	}
 
 	if (dev->net_dev) {
 		unregister_netdev(dev->net_dev);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-09 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-31 13:06 [dpdk-dev] [PATCH] kni: fix crash for KNI interface remove Ferruh Yigit
2016-09-09 13:46 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).