Skip to content

Commit

Permalink
devargs: fix crash with uninitialized parsing
Browse files Browse the repository at this point in the history
[ upstream commit 356a2aa ]

The function rte_devargs_parse() previously was safe to call with
non-initialized devargs structure as parameter.

When adding the support for the global device syntax,
this assumption was broken.
Restore it by forcing memset as part of the call itself.

Bugzilla ID: 933
Fixes: b344eb5 ("devargs: parse global device syntax")

Signed-off-by: Madhuker Mythri <madhuker.mythri@oracle.com>
Signed-off-by: Gaetan Rivet <grive@u256.net>
  • Loading branch information
Madhuker Mythri authored and kevintraynor committed Mar 1, 2022
1 parent 411a43e commit d3e4a2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/eal/common/eal_common_devargs.c
Expand Up @@ -191,6 +191,7 @@ rte_devargs_parse(struct rte_devargs *da, const char *dev)

if (da == NULL)
return -EINVAL;
memset(da, 0, sizeof(*da));

/* First parse according global device syntax. */
if (rte_devargs_layers_parse(da, dev) == 0) {
Expand Down

0 comments on commit d3e4a2c

Please sign in to comment.