From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 0C93FD4A4 for ; Sun, 29 Jan 2017 23:35:41 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id b65so8606019wmf.0 for ; Sun, 29 Jan 2017 14:35:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=pgEDcF9wAUwiC8hNcbcP7egeGZhvgEE4X41DMYs8kv8=; b=n3+bxf/4U1AaRBBo8/YO3jM3Cj/4cfbUpT3T8zS7+ZThZWOO9vi2yNhHlap1cNNiGg diALnSQkhWuDk08/6kz5h5NDHlcWPC7mTgmpKw9pjVVCO3DqxxLcZZ/oCtvWf8k/SmZn Y3/BtvChr++mV9dOYbsIGy9F9/j01piCAK/slgSG7uxHG81aOMiZXr2fEquXcxqwIVHA JiNCT052X/n8iZ1pFt9GN9SibUePIV3QzUN+JTKzAcg7+cTXqr516JxDykSDKCzOOwxW JACeMwSCu+cA0ylpSN+KOUwMtNaXPq1HXCCZOLPv3HMY41LP8J1rfn1EW6fpztxQ0Nwq EDqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=pgEDcF9wAUwiC8hNcbcP7egeGZhvgEE4X41DMYs8kv8=; b=WFsecfiU5q+jqJke4q5rfxzmcESrJsVEaGbNWhEipj24p+E+INv+BhsC9U0HiZTHJk /ytTxn5eye0K/H8j6GjMvdp+VcLQAWJV4hpDpPzVDzk6wG7x5kqYaEcUl55chAO53eWH H5XEm9Y2coM4B5Vt8GDquKHIfUfh+/8x9Er7JtCxt18dZe4M+yafyxjvUad8gOldb4ty +4dpFFjdBsxL7mBQzqxr8EvZAL47+qu1Qpw1hyLN/DfCNBI4gp807ff316OS0bzBD1hg cIZr1SuieZi7LGZkhKOUXqfw7/Mr/VRsgtgKfR509oguGtw58+aK1YvjXLFfLDnifN19 PcsQ== X-Gm-Message-State: AIkVDXIPE1WGWWH345QrLvA//gyxFqKLskof2VmZUY3OhJjWPTP+Czsx2UMBhFJoB6t3SmU4 X-Received: by 10.28.103.3 with SMTP id b3mr10687268wmc.99.1485729341680; Sun, 29 Jan 2017 14:35:41 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id o42sm19719579wrb.18.2017.01.29.14.35.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jan 2017 14:35:40 -0800 (PST) From: Thomas Monjalon To: Emmanuel Roullit Cc: dev@dpdk.org, stable@dpdk.org Date: Sun, 29 Jan 2017 23:35:39 +0100 Message-ID: <2487536.DRxuiboR0Q@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20170124202656.792-1-emmanuel.roullit@gmail.com> References: <20170124202656.792-1-emmanuel.roullit@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: reset driver name pointer on failure 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: Sun, 29 Jan 2017 22:35:42 -0000 2017-01-24 21:26, Emmanuel Roullit: > 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: 3fe2e5fec82b ("eal: fix argument parsing check") The real bug origin is: Fixes: 0fe11ec592b2 ("eal: add vdev init and uninit") > Signed-off-by: Emmanuel Roullit Applied, thanks