From: Declan Doherty Date: Wed, 2 May 2018 15:59:41 +0000 (+0100) Subject: net/ixgbe: check probing error X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a34506b3a556c541350c3baf620ca64d50485865;p=dpdk.git net/ixgbe: check probing error Add NULL parameter check for rte_eth_dev_allocated() API call to eth_ixgbe_pci_probe(). Coverity Issue: 277216 Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports") Signed-off-by: Declan Doherty Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index a05527a918..91179e9b2c 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1745,9 +1745,11 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, if (retval || eth_da.nb_representor_ports < 1) return retval; - /* probe VF representor ports */ pf_ethdev = rte_eth_dev_allocated(pci_dev->device.name); + if (pf_ethdev == NULL) + return -ENODEV; + /* probe VF representor ports */ for (i = 0; i < eth_da.nb_representor_ports; i++) { struct ixgbe_vf_info *vfinfo; struct ixgbe_vf_representor representor;