qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
	"aneesh.kumar@linux.vnet.ibm.com"
	<aneesh.kumar@linux.vnet.ibm.com>,
	"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/2] virtfs-proxy-helper: Fix handle leak to make Coverity happy
Date: Fri, 28 Nov 2014 15:41:55 +0800	[thread overview]
Message-ID: <54782743.2020201@huawei.com> (raw)
In-Reply-To: <87lhmv9419.fsf@blackfin.pond.sub.org>

On 2014/11/28 15:29, Markus Armbruster wrote:

> Since this is main(), the "caller" is the OS.  And yes, the OS closes
> the -f file descriptor when main() returns, because it closes *all* file
> descriptors.  Calling close() before return from main() is pointless,
> unless you check for errors.
> 
> Unfortunately, Coverity doesn't understand this.  Calling close() in
> main() suppresses its bogus defect report.
> 

Yes.

>>> >> If sock >= 0 is pointless, too, but needed to hush up Coverity.
>> >
>> > You mean do not check sock_name is NULL or not?
> Yes, unless it causes another bogus Coverity defect.
> 
> Or simply mark the defect as invalid and move on without patching the
> code.

Let's drop this patch, thanks.

Regards,
-Gonglei

  reply	other threads:[~2014-11-28  7:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 12:17 [Qemu-devel] [PATCH 0/2] virtfs-proxy-helper: Fix Coverity warning arei.gonglei
2014-11-13 12:17 ` [Qemu-devel] [PATCH 1/2] virtfs-proxy-helper: Fix possible socket leak arei.gonglei
2014-11-27 12:49   ` Markus Armbruster
2015-01-21  8:00     ` Gonglei
2015-01-21  8:06       ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-11-13 12:17 ` [Qemu-devel] [PATCH 2/2] virtfs-proxy-helper: Fix handle leak to make Coverity happy arei.gonglei
2014-11-27 12:47   ` Markus Armbruster
2014-11-28  1:51     ` Gonglei
2014-11-28  7:29       ` Markus Armbruster
2014-11-28  7:41         ` Gonglei [this message]
2014-11-27 10:29 ` [Qemu-devel] [PATCH 0/2] virtfs-proxy-helper: Fix Coverity warning Gonglei
2014-11-28  8:31   ` Paolo Bonzini
2014-11-28  8:34     ` Gonglei

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=54782743.2020201@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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).