DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ouyang, Changchun" <changchun.ouyang@intel.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] af_packet: Fix some klocwork errors
Date: Sat, 28 Feb 2015 00:51:23 +0000	[thread overview]
Message-ID: <F52918179C57134FAEC9EA62FA2F9625119FEBEC@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20150227140431.GC1611@hmsreliant.think-freely.org>



> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Friday, February 27, 2015 10:05 PM
> To: Ouyang, Changchun
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] af_packet: Fix some klocwork errors
> 
> On Fri, Feb 27, 2015 at 08:49:13AM +0800, Ouyang Changchun wrote:
> > Fix possible memory leak issue: free kvlist before return; Fix
> > possible resource lost issue: close qssockfd before return;
> >
> > Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
> > ---
> > change in v2:
> >   - Make the error exit point a common path.
> >
> >  lib/librte_pmd_af_packet/rte_eth_af_packet.c | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/librte_pmd_af_packet/rte_eth_af_packet.c
> > b/lib/librte_pmd_af_packet/rte_eth_af_packet.c
> > index 80e9bdf..c675724 100644
> > --- a/lib/librte_pmd_af_packet/rte_eth_af_packet.c
> > +++ b/lib/librte_pmd_af_packet/rte_eth_af_packet.c
> > @@ -694,6 +694,8 @@ error:
> >  		}
> >  		rte_free(*internals);
> >  	}
> > +	if (qsockfd != -1)
> > +		close(qsockfd);
> This is insufficient.  qsockfd is a loop index that is reassigned for each tx
> queue we have.  In the error path you need to do this, and loop through the
> tx queues, closing each tx_queue->sockfd.
> 

Thanks, will have a v3 to resolve it.
Changchun

  reply	other threads:[~2015-02-28  0:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  6:42 [dpdk-dev] [PATCH] " Ouyang Changchun
2015-02-26  8:44 ` Pawel Wodkowski
2015-02-27  0:49 ` [dpdk-dev] [PATCH v2] " Ouyang Changchun
2015-02-27 14:04   ` Neil Horman
2015-02-28  0:51     ` Ouyang, Changchun [this message]
2015-02-28  1:27   ` [dpdk-dev] [PATCH v3] " Ouyang Changchun
2015-03-09  3:49     ` [dpdk-dev] [PATCH v4] " Ouyang Changchun
2015-03-09  6:38       ` Qiu, Michael
2015-03-09  8:47         ` Ouyang, Changchun
2015-03-09  8:58       ` [dpdk-dev] [PATCH v5] " Ouyang Changchun
2015-03-09 19:25         ` John W. Linville
2015-03-10  3:29         ` [dpdk-dev] [PATCH v6] " Ouyang Changchun
2015-03-10  8:36           ` Pawel Wodkowski
2015-03-10  8:49             ` Ouyang, Changchun
2015-03-10  8:59               ` Pawel Wodkowski
2015-03-10 10:19               ` Thomas Monjalon
2015-03-11  1:18                 ` Ouyang, Changchun
2015-03-11  1:34           ` [dpdk-dev] [PATCH v7] " Ouyang Changchun
2015-03-12 10:43             ` Qiu, Michael
2015-03-12 13:38               ` Neil Horman
2015-03-12 17:09                 ` John W. Linville
2015-03-17 21:34                   ` 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=F52918179C57134FAEC9EA62FA2F9625119FEBEC@shsmsx102.ccr.corp.intel.com \
    --to=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    --cc=nhorman@tuxdriver.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).