From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so2.wedos.net (wes1-so2.wedos.net [46.28.106.16]) by dpdk.org (Postfix) with ESMTP id 2056C91E7 for ; Mon, 4 Jan 2016 21:09:52 +0100 (CET) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so2.wedos.net (Postfix) with ESMTPSA id 3pZ7NH6x9Nzs1; Mon, 4 Jan 2016 21:09:51 +0100 (CET) From: Jan Viktorin To: dev@dpdk.org Date: Mon, 4 Jan 2016 21:08:25 +0100 Message-Id: <1451938106-12145-14-git-send-email-viktorin@rehivetech.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1451938106-12145-1-git-send-email-viktorin@rehivetech.com> References: <1451938106-12145-1-git-send-email-viktorin@rehivetech.com> Cc: Jan Viktorin Subject: [dpdk-dev] [PATCH 13/14] lib/ether: check magic in rte_eth_copy_pci_info 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: Mon, 04 Jan 2016 20:09:52 -0000 Signed-off-by: Jan Viktorin --- lib/librte_ether/rte_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 6fb3423..75121bc 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3293,6 +3293,12 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de return; } + if (eth_dev->dev->magic != RTE_PCI_DEVICE_MAGIC) { + rte_panic("%s() unexpected device magic: %08x\n", + __func__, eth_dev->dev->magic); + return; + } + 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.6.3