From: Bernard Iremonger Date: Fri, 6 Nov 2015 17:20:01 +0000 (+0000) Subject: ethdev: fix error handling in PCI fields copy X-Git-Tag: spdx-start~8100 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7a69f724518d7ada83a0b60cb7183a5520e3158d;p=dpdk.git 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 --- 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;