From: Madhuker Mythri Date: Mon, 14 Feb 2022 17:08:11 +0000 (+0530) Subject: devargs: fix crash with uninitialized parsing X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=356a2aa054a9e803782ee8380a7ab1a53aecd1e3;p=dpdk.git devargs: fix crash with uninitialized parsing 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 Signed-off-by: Gaetan Rivet --- diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c index 8da3ba3879..d5833af373 100644 --- a/lib/eal/common/eal_common_devargs.c +++ b/lib/eal/common/eal_common_devargs.c @@ -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) {