From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C6C261B2C2 for ; Mon, 6 Nov 2017 15:19:20 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 06 Nov 2017 06:19:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,352,1505804400"; d="scan'208";a="172571358" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by fmsmga006.fm.intel.com with ESMTP; 06 Nov 2017 06:19:17 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Mon, 6 Nov 2017 13:58:00 +0000 Message-Id: <20171106135800.12350-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] eal: fix check for default plugin directory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 14:19:21 -0000 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 --- 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 450f2664a..996a03424 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.13.6