From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: [PATCH v6 18/21] ether: verify we copy info from a PCI device Date: Thu, 27 Oct 2016 20:47:44 +0530 Message-ID: <1477581467-12588-19-git-send-email-shreyansh.jain@nxp.com> References: <1477310380-17944-1-git-send-email-shreyansh.jain@nxp.com> <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Shreyansh Jain , thomas.monjalon@6wind.com, viktorin@rehivetech.com To: Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0041.outbound.protection.outlook.com [104.47.36.41]) by dpdk.org (Postfix) with ESMTP id 81264BB74 for ; Thu, 27 Oct 2016 17:18:12 +0200 (CEST) In-Reply-To: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jan Viktorin Now that different types of ethdev exist, check for presence of PCI dev while copying out the info. Similar would be done for SoC. Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain Signed-off-by: Hemant Agrawal --- lib/librte_ether/rte_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 347c230..a1e3aaf 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3206,6 +3206,8 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de return; } + RTE_VERIFY(eth_dev->pci_dev != NULL); + eth_dev->data->dev_flags = 0; if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; -- 2.7.4