ethdev: fix error returned for invalid port id
authorLiang-Min Larry Wang <liang-min.wang@intel.com>
Wed, 15 Jul 2015 17:22:40 +0000 (13:22 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 16 Jul 2015 21:56:12 +0000 (23:56 +0200)
Fix return value, using the macro input instead of -EINVAL.

Fixes: 75acd57ad025 ("ethdev: introduce valid port helper")

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_ether/rte_ethdev.c

index ddf3658..a957d9a 100644 (file)
 #define VALID_PORTID_OR_ERR_RET(port_id, retval) do {          \
        if (!rte_eth_dev_is_valid_port(port_id)) {              \
                PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
-               return -EINVAL;                                 \
+               return retval;                                  \
        }                                                       \
 } while (0)