From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6BE519E7 for ; Wed, 31 Aug 2016 15:08:19 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 31 Aug 2016 06:06:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,262,1470726000"; d="scan'208";a="162862553" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 31 Aug 2016 06:06:30 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u7VD6R0V008851 for ; Wed, 31 Aug 2016 14:06:27 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u7VD6RAL032441 for ; Wed, 31 Aug 2016 14:06:27 +0100 Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u7VD6RRE032437 for dev@dpdk.org; Wed, 31 Aug 2016 14:06:27 +0100 X-Authentication-Warning: sivswdev02.ir.intel.com: fyigit set sender to ferruh.yigit@intel.com using -f From: Ferruh Yigit To: dev@dpdk.org Date: Wed, 31 Aug 2016 14:06:26 +0100 Message-Id: <1472648786-32404-1-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] kni: fix crash for KNI interface remove X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 13:09:59 -0000 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 --- 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