ethdev: fix error handling in PCI fields copy
authorBernard Iremonger <bernard.iremonger@intel.com>
Fri, 6 Nov 2015 17:20:01 +0000 (17:20 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 10 Nov 2015 16:06:53 +0000 (17:06 +0100)
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 <bernard.iremonger@intel.com>
lib/librte_ether/rte_ethdev.c

index e0e1dca..1b73f29 100644 (file)
@@ -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;