net/bnxt: fail init when mbuf allocation fails
[dpdk.git] / drivers / net / failsafe / failsafe_args.c
index 3351c5b..b203e02 100644 (file)
@@ -367,16 +367,12 @@ static int
 fs_get_mac_addr_arg(const char *key __rte_unused,
                const char *value, void *out)
 {
-       struct ether_addr *ea = out;
-       int ret;
+       struct rte_ether_addr *ea = out;
 
        if ((value == NULL) || (out == NULL))
                return -EINVAL;
-       ret = sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
-               &ea->addr_bytes[0], &ea->addr_bytes[1],
-               &ea->addr_bytes[2], &ea->addr_bytes[3],
-               &ea->addr_bytes[4], &ea->addr_bytes[5]);
-       return ret != ETHER_ADDR_LEN;
+
+       return rte_ether_unformat_addr(value, ea);
 }
 
 int
@@ -455,8 +451,7 @@ failsafe_args_free(struct rte_eth_dev *dev)
                sdev->cmdline = NULL;
                free(sdev->fd_str);
                sdev->fd_str = NULL;
-               free(sdev->devargs.args);
-               sdev->devargs.args = NULL;
+               rte_devargs_reset(&sdev->devargs);
        }
 }