All of lore.kernel.org
 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-trivial] [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



WARNING: multiple messages have this Message-ID (diff)
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:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 12:17 [Qemu-trivial] [PATCH 0/2] virtfs-proxy-helper: Fix Coverity warning arei.gonglei
2014-11-13 12:17 ` [Qemu-devel] " arei.gonglei
2014-11-13 12:17 ` [Qemu-trivial] [PATCH 1/2] virtfs-proxy-helper: Fix possible socket leak arei.gonglei
2014-11-13 12:17   ` [Qemu-devel] " arei.gonglei
2014-11-27 12:49   ` [Qemu-trivial] " Markus Armbruster
2014-11-27 12:49     ` Markus Armbruster
2015-01-21  8:00     ` [Qemu-trivial] " Gonglei
2015-01-21  8:00       ` Gonglei
2015-01-21  8:06       ` [Qemu-trivial] " Michael Tokarev
2015-01-21  8:06         ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-11-13 12:17 ` [Qemu-trivial] [PATCH 2/2] virtfs-proxy-helper: Fix handle leak to make Coverity happy arei.gonglei
2014-11-13 12:17   ` [Qemu-devel] " arei.gonglei
2014-11-27 12:47   ` [Qemu-trivial] " Markus Armbruster
2014-11-27 12:47     ` Markus Armbruster
2014-11-28  1:51     ` [Qemu-trivial] " Gonglei
2014-11-28  1:51       ` Gonglei
2014-11-28  7:29       ` [Qemu-trivial] " Markus Armbruster
2014-11-28  7:29         ` Markus Armbruster
2014-11-28  7:41         ` Gonglei [this message]
2014-11-28  7:41           ` Gonglei
2014-11-27 10:29 ` [Qemu-trivial] [PATCH 0/2] virtfs-proxy-helper: Fix Coverity warning Gonglei
2014-11-27 10:29   ` [Qemu-devel] " Gonglei
2014-11-28  8:31   ` [Qemu-trivial] " Paolo Bonzini
2014-11-28  8:31     ` [Qemu-devel] " Paolo Bonzini
2014-11-28  8:34     ` [Qemu-trivial] " Gonglei
2014-11-28  8:34       ` [Qemu-devel] " 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.