git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/virtio-user: fix devargs parsing
[dpdk.git]
/
drivers
/
net
/
virtio
/
virtio_user_ethdev.c
diff --git
a/drivers/net/virtio/virtio_user_ethdev.c
b/drivers/net/virtio/virtio_user_ethdev.c
index
5637001
..
741b3b0
100644
(file)
--- a/
drivers/net/virtio/virtio_user_ethdev.c
+++ b/
drivers/net/virtio/virtio_user_ethdev.c
@@
-477,12
+477,17
@@
static int
get_integer_arg(const char *key __rte_unused,
const char *value, void *extra_args)
{
get_integer_arg(const char *key __rte_unused,
const char *value, void *extra_args)
{
+ uint64_t integer = 0;
if (!value || !extra_args)
return -EINVAL;
if (!value || !extra_args)
return -EINVAL;
-
- *(uint64_t *)extra_args = strtoull(value, NULL, 0);
-
- return 0;
+ errno = 0;
+ integer = strtoull(value, NULL, 0);
+ /* extra_args keeps default value, it should be replaced
+ * only in case of successful parsing of the 'value' arg
+ */
+ if (errno == 0)
+ *(uint64_t *)extra_args = integer;
+ return -errno;
}
static struct rte_eth_dev *
}
static struct rte_eth_dev *