unsigned numa_node;
unsigned packet_size = default_packet_size;
unsigned packet_copy = default_packet_copy;
- struct rte_kvargs *kvlist;
+ struct rte_kvargs *kvlist = NULL;
int ret;
if (name == NULL)
ETH_NULL_PACKET_SIZE_ARG,
&get_packet_size_arg, &packet_size);
if (ret < 0)
- return -1;
+ goto free_kvlist;
}
if (rte_kvargs_count(kvlist, ETH_NULL_PACKET_COPY_ARG) == 1) {
ETH_NULL_PACKET_COPY_ARG,
&get_packet_copy_arg, &packet_copy);
if (ret < 0)
- return -1;
+ goto free_kvlist;
}
}
"packet copy is %s\n", packet_size,
packet_copy ? "enabled" : "disabled");
- return eth_dev_null_create(name, numa_node, packet_size, packet_copy);
+ ret = eth_dev_null_create(name, numa_node, packet_size, packet_copy);
+
+free_kvlist:
+ if (kvlist)
+ rte_kvargs_free(kvlist);
+ return ret;
}
static int