]> git.droids-corp.org - dpdk.git/commitdiff
devargs: fix crash with uninitialized parsing
authorMadhuker Mythri <madhuker.mythri@oracle.com>
Mon, 14 Feb 2022 17:08:11 +0000 (22:38 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 27 Feb 2022 18:28:59 +0000 (19:28 +0100)
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: b344eb5d941a ("devargs: parse global device syntax")
Cc: stable@dpdk.org
Signed-off-by: Madhuker Mythri <madhuker.mythri@oracle.com>
Signed-off-by: Gaetan Rivet <grive@u256.net>
lib/eal/common/eal_common_devargs.c

index 8da3ba3879af6589b388f25e4b5ff0bfa8ecfe27..d5833af3739084dd31ef6637748d6fbd6461f7dd 100644 (file)
@@ -189,6 +189,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) {