From dd74b786f24a1e8c4e6656b94c73ab0d217de023 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 6 Nov 2017 13:58:00 +0000 Subject: [PATCH] eal: fix check for default plugin directory The check for the existence of the default plugin directory calls stat using an incorrect variable, which will cause a NULL pointer dereference error. Coverity issue: 198440 Fixes: d6a4399cdfc9 ("eal: avoid error for non-existent default PMD path") Signed-off-by: Bruce Richardson Acked-by: Aaron Conole --- lib/librte_eal/common/eal_common_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 450f2664a0..996a034248 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -280,7 +280,7 @@ eal_plugins_init(void) struct shared_driver *solib = NULL; struct stat sb; - if (*default_solib_dir != '\0' && stat(solib->name, &sb) == 0 && + if (*default_solib_dir != '\0' && stat(default_solib_dir, &sb) == 0 && S_ISDIR(sb.st_mode)) eal_plugin_add(default_solib_dir); -- 2.20.1