From 7a69f724518d7ada83a0b60cb7183a5520e3158d Mon Sep 17 00:00:00 2001 From: Bernard Iremonger Date: Fri, 6 Nov 2015 17:20:01 +0000 Subject: [PATCH] ethdev: fix error handling in PCI fields copy add return statement to if branch Dereferencing NULL pointer reported by Coverity, CID 119256. Dereferencing NULL pointer reported by Coverity, CID 119257. Fixes: 494adb7f63f2 ("ethdev: add device fields from PCI layer") Signed-off-by: Bernard Iremonger --- lib/librte_ether/rte_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index e0e1dca34e..1b73f2937d 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3276,6 +3276,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de if ((eth_dev == NULL) || (pci_dev == NULL)) { PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n", eth_dev, pci_dev); + return; } eth_dev->data->dev_flags = 0; -- 2.20.1