From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4D9699E7 for ; Wed, 15 Feb 2017 07:24:38 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 22:24:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,164,1484035200"; d="scan'208";a="1094927425" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 14 Feb 2017 22:24:36 -0800 From: Yuanhan Liu To: Emmanuel Roullit Cc: Yuanhan Liu , dpdk stable Date: Wed, 15 Feb 2017 14:26:13 +0800 Message-Id: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 Subject: [dpdk-stable] patch 'devargs: reset driver name pointer on parsing failure' has been queued to stable release 16.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 06:24:38 -0000 Hi, FYI, your patch has been queued to stable release 16.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/18/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 636b0b46e2c77f3738affa647c5e8e6eed20f74f Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Tue, 24 Jan 2017 21:26:56 +0100 Subject: [PATCH] devargs: reset driver name pointer on parsing failure [ upstream commit 3cdfdf2a3303bb50d98c4f1689fc4b3745ea1e4f ] The pointer set by strdup() needs to be cleared on failure to avoid a potential double-free from the caller. Found with clang static analysis: lib/librte_eal/common/eal_common_devargs.c:123:2: warning: Attempt to free released memory free(buf); ^~~~~~~~~ Fixes: 0fe11ec592b2 ("eal: add vdev init and uninit") Signed-off-by: Emmanuel Roullit --- lib/librte_eal/common/eal_common_devargs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index e403717..ffa8ad9 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -72,6 +72,7 @@ rte_eal_parse_devargs_str(const char *devargs_str, if (*drvargs == NULL) { free(*drvname); + *drvname = NULL; return -1; } return 0; -- 1.9.0