net/ixgbe: fix probe with no devargs
authorDeclan Doherty <declan.doherty@intel.com>
Wed, 2 May 2018 15:59:40 +0000 (16:59 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 2 May 2018 17:28:48 +0000 (19:28 +0200)
Initialise rte_ethdev_args parameters to zero to handle
the case where no devargs are passed to the IXGBE PF on
device probe, so that there is no invalid attempts to create
representor ports.

Coverity Issue: 277231
Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index e49319a..a05527a 100644 (file)
@@ -1734,7 +1734,8 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
                                &eth_da);
                if (retval)
                        return retval;
-       }
+       } else
+               memset(&eth_da, 0, sizeof(eth_da));
 
        retval = rte_eth_dev_create(&pci_dev->device, pci_dev->device.name,
                sizeof(struct ixgbe_adapter),