DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [dpdk-dev] [PATCH] pmdinfogen: fix resource leak of FILE object
Date: Tue, 06 Feb 2018 01:16:35 +0100	[thread overview]
Message-ID: <2667705.0fuXX6fmai@xps> (raw)
In-Reply-To: <20180202184721.GC21773@hmswarspite.think-freely.org>

02/02/2018 19:47, Neil Horman:
> On Fri, Feb 02, 2018 at 03:51:12PM +0000, Bruce Richardson wrote:
> > On Fri, Feb 02, 2018 at 03:47:43PM +0000, Bruce Richardson wrote:
> > > On Fri, Feb 02, 2018 at 07:44:39AM -0500, Neil Horman wrote:
> > > > On Fri, Feb 02, 2018 at 12:00:58PM +0000, Bruce Richardson wrote:
> > > > > Coverity flags an issue where the resources used by the FILE object for
> > > > > the temporary input file are leaked. This is a very minor issue, but is
> > > > > easily fixed, while also avoiding later problems where we try to close
> > > > > an invalid file descriptor in the failure case.
> > > > > 
> > > > > The fix is to use "dup()" to get a new file descriptor number rather than
> > > > > using the value directly from fileno. This allows us to close the file
> > > > > opened with tmpfile() within in scope block, while allowing the duplicate
> > > > > to pass to the outer block and be closed when the function terminates.
> > > > > 
> > > > > As a side-effect I/O in the function is therefore changed from using stdio
> > > > > fread/fwrite to read/write system calls.
> > > > > 
> > > > > Coverity issue: 260399
> > > > > Fixes: 0d68533617e3 ("pmdinfogen: allow using stdin and stdout")
> > > > > 
> > > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
[...]
> Acked-by: Neil Horman <nhorman@tuxdriver.com>

Applied, thanks

      reply	other threads:[~2018-02-06  0:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 12:00 Bruce Richardson
2018-02-02 12:44 ` Neil Horman
2018-02-02 15:47   ` Bruce Richardson
2018-02-02 15:51     ` Bruce Richardson
2018-02-02 18:47       ` Neil Horman
2018-02-06  0:16         ` Thomas Monjalon [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=2667705.0fuXX6fmai@xps \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@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).