From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: Re: [PATCH] eal: Fix wrong error checking of rte_eal_parse_devargs_str() Date: Wed, 15 Jun 2016 16:48:38 +0200 Message-ID: References: <1465961209-28309-1-git-send-email-mukawa@igel.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "dev@dpdk.org" , "Mcnamara, John" , michalx.k.jastrzebski@intel.com To: Tetsuya Mukawa Return-path: Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by dpdk.org (Postfix) with ESMTP id 68546C75A for ; Wed, 15 Jun 2016 16:48:58 +0200 (CEST) Received: by mail-lf0-f47.google.com with SMTP id l188so13187951lfe.2 for ; Wed, 15 Jun 2016 07:48:58 -0700 (PDT) In-Reply-To: <1465961209-28309-1-git-send-email-mukawa@igel.co.jp> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jun 15, 2016 at 5:26 AM, Tetsuya Mukawa wrote: > Currently, a return value of strdup() isn't checked correctly. > The patch fixes it. > > Signed-off-by: Tetsuya Mukawa Idem, the title does not need the function name to describe what is going wrong. This might deserve a fixline, I traced this to 0fe11ec592b2 ("eal: add vdev init and uninit"). > --- > lib/librte_eal/common/eal_common_devargs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c > index 2bfe54a..e403717 100644 > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > @@ -58,7 +58,7 @@ rte_eal_parse_devargs_str(const char *devargs_str, > return -1; > > *drvname = strdup(devargs_str); > - if (drvname == NULL) > + if (*drvname == NULL) > return -1; > > /* set the first ',' to '\0' to split name and arguments */ > -- > 2.7.4 > -- David Marchand