From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: "Wu, Jingjing" <jingjing.wu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix memory leak
Date: Mon, 30 Jan 2017 12:26:47 +0000 [thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D897476D185E@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <20170130093318.GB10133@6wind.com>
Hi Adrien,
> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Monday, January 30, 2017 9:33 AM
> To: De Lara Guarch, Pablo
> Cc: Wu, Jingjing; dev@dpdk.org
> Subject: Re: [PATCH v2] app/testpmd: fix memory leak
>
> Hi Pablo,
>
> On Fri, Jan 27, 2017 at 02:54:58PM +0000, Pablo de Lara wrote:
> > Free memory when port flow entry creation fails.
> >
> > Coverity issue: 139600
> > Fixes: 938a184a1870 ("app/testpmd: implement basic support for flow
> API")
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > ---
> > Changes in v2:
> >
> > - Removed unnecessary conditional
> >
> > app/test-pmd/config.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> > index 5834498..467932f 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -954,6 +954,7 @@ port_flow_new(const struct rte_flow_attr *attr,
> > goto store;
> > }
> > notsup:
> > + free(pf);
> > rte_errno = err;
> > return NULL;
> > }
> > --
> > 2.7.4
> >
>
> I think this is a false positive, which is why I did not address it during
> the last round of Coverity issues.
>
> As a two-pass function, errors are checked during the first pass, when pf is
> not allocated yet. During the second pass, intermediate functions are not
> supposed to return a different result and "notsup" cannot occur.
>
> I think assert()/rte_assert() would make more sense and should fool
> Coverity
> into understanding the expected behavior.
>
> The commit log should reflect that we are addressing a false positive since
> there is no problem with the code logic (of course unless I missed anything
> obvious).
Then, I would just ignore the coverity issue, changing the status to intentional.
Thanks,
Pablo
>
> Thanks.
>
> --
> Adrien Mazarguil
> 6WIND
prev parent reply other threads:[~2017-01-30 12:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 13:15 [dpdk-dev] [PATCH] " Pablo de Lara
2017-01-27 14:54 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
2017-01-30 9:33 ` Adrien Mazarguil
2017-01-30 12:26 ` De Lara Guarch, Pablo [this message]
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=E115CCD9D858EF4F90C690B0DCB4D897476D185E@IRSMSX108.ger.corp.intel.com \
--to=pablo.de.lara.guarch@intel.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@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).