From: Wei Hu (Xavier) Date: Tue, 14 Jul 2020 08:19:43 +0000 (+0800) Subject: net/bonding: fix error code on device creation X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2dd4f08540cc32cc1a62579d66d055327638ac92;p=dpdk.git net/bonding: fix error code on device creation Because the return value of rte_vdev_init() has multiple non-zero values, when rte_vdev_init() return non-zero in the rte_eth_bond_create() function, it should return the actual error code rather than -ENOMEM. Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free") Cc: stable@dpdk.org Signed-off-by: Wei Hu (Xavier) --- diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index f38eb3b47f..d77dc40963 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -167,7 +167,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) ret = rte_vdev_init(name, devargs); if (ret) - return -ENOMEM; + return ret; ret = rte_eth_dev_get_port_by_name(name, &port_id); RTE_ASSERT(!ret);