From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by dpdk.org (Postfix) with ESMTP id C3E54A6A for ; Mon, 2 Mar 2015 13:23:59 +0100 (CET) Received: by mail-ob0-f173.google.com with SMTP id uy5so30837690obc.4 for ; Mon, 02 Mar 2015 04:23:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=a+vNdLo1f16Ml14qtO3A7w4XCa4YWfPDG4/g3UxXpbM=; b=EWpmt1wWMXcGfmeVMxMh+WHbxSq0nNVBzpAQoiOY4r1+1p57DKyJ61vfi1yhMk0UP4 jNQ9cRamQiiZErdIWMQYkDDZG04nSw1T2bXzEF0F7SM9YxiHee3vMNP2XFNuoVoSDazJ wrJnR7VihGaF/Tc2vix3+QAgo4nuClZIdu5BWU/QfoAqKkTcdTfD2AI0I7F0rRi5hQne H3jVtmv2zMwo4Ja7/84kbsC0N8QcVdoBlG7kyfPXdZJFHlr6KErf7X2QVV+5fwy7ByXB sWDKI2i5+O8wO96kfzS4fzRuhldO2Ay8DWIjpit2F6NEpWIM1epTLWK4Id5YJM+1dvBV 5/Sw== X-Gm-Message-State: ALoCoQnYuVuhyht3Zej3OCt/EoJ+dw+v5uz6Kocd27jal3kyB8nBKghlJ6C+Zx3GdE/ckYJMn/fM MIME-Version: 1.0 X-Received: by 10.202.108.137 with SMTP id h131mr17944759oic.90.1425299039092; Mon, 02 Mar 2015 04:23:59 -0800 (PST) Received: by 10.76.34.35 with HTTP; Mon, 2 Mar 2015 04:23:59 -0800 (PST) In-Reply-To: <1425294562-26015-1-git-send-email-pawelx.wodkowski@intel.com> References: <1425294562-26015-1-git-send-email-pawelx.wodkowski@intel.com> Date: Mon, 2 Mar 2015 13:23:59 +0100 Message-ID: From: David Marchand To: Pawel Wodkowski Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] eal: prevent dereferencing NULL pointer in rte_eal_devargs_add() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 12:24:00 -0000 Hello Pawel, On Mon, Mar 2, 2015 at 12:09 PM, Pawel Wodkowski wrote: > On failure devargs->args should not be accesed if devargs is NULL. > accessed. > > Signed-off-by: Pawel Wodkowski > --- > lib/librte_eal/common/eal_common_devargs.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_devargs.c > b/lib/librte_eal/common/eal_common_devargs.c > index 9b110f7..615945e 100644 > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > @@ -124,12 +124,13 @@ rte_eal_devargs_add(enum rte_devtype devtype, const > char *devargs_str) > return 0; > > fail: > - if (devargs->args) > - free(devargs->args); > if (buf) > free(buf); > - if (devargs) > + if (devargs) { > + free(devargs->args); > free(devargs); > + } > + > return -1; > } > > Fixes: c07691ae1089 ("devargs: remove limit on parameters length") Acked-by: David Marchand -- David Marchand