DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal: prevent dereferencing NULL pointer in rte_eal_devargs_add()
Date: Mon, 2 Mar 2015 13:23:59 +0100	[thread overview]
Message-ID: <CALwxeUuE1AjtZVpJrkJuXt6eGKEt97Rhi+-9OLC+=iuc+6FWWw@mail.gmail.com> (raw)
In-Reply-To: <1425294562-26015-1-git-send-email-pawelx.wodkowski@intel.com>

Hello Pawel,

On Mon, Mar 2, 2015 at 12:09 PM, Pawel Wodkowski <pawelx.wodkowski@intel.com
> wrote:

> On failure devargs->args should not be accesed if devargs is NULL.
>

accessed.


>
> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
> ---
>  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@6wind.com>

-- 
David Marchand

  reply	other threads:[~2015-03-02 12:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 11:09 Pawel Wodkowski
2015-03-02 12:23 ` David Marchand [this message]
2015-03-02 14:40   ` Wiles, Keith
2015-03-02 14:55     ` Pawel Wodkowski
2015-03-02 16:47       ` Wiles, Keith
2015-03-02 17:35         ` Pawel Wodkowski
2015-03-02 18:39   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALwxeUuE1AjtZVpJrkJuXt6eGKEt97Rhi+-9OLC+=iuc+6FWWw@mail.gmail.com' \
    --to=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=pawelx.wodkowski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).