From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefano Stabellini <sstabellini@kernel.org>, qemu-devel@nongnu.org
Cc: xen-devel@lists.xen.org, groug@kaod.org, Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] Check the return value of fcntl in qemu_set_cloexec
Date: Thu, 11 May 2017 09:55:29 +0200 [thread overview]
Message-ID: <a2b87b82-8ae2-20bf-dc08-aa32a8fda23f@redhat.com> (raw)
In-Reply-To: <1494356693-13190-2-git-send-email-sstabellini@kernel.org>
On 09/05/2017 21:04, Stefano Stabellini wrote:
> Assert that the return value is not an error. This issue was found by
> Coverity.
>
> CID: 1374831
>
> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
> CC: groug@kaod.org
> CC: pbonzini@redhat.com
> CC: Eric Blake <eblake@redhat.com>
Queued, thanks.
Paolo
> ---
> util/oslib-posix.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index 4d9189e..16894ad 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -182,7 +182,9 @@ void qemu_set_cloexec(int fd)
> {
> int f;
> f = fcntl(fd, F_GETFD);
> - fcntl(fd, F_SETFD, f | FD_CLOEXEC);
> + assert(f != -1);
> + f = fcntl(fd, F_SETFD, f | FD_CLOEXEC);
> + assert(f != -1);
> }
>
> /*
>
next prev parent reply other threads:[~2017-05-11 7:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 19:04 [Qemu-devel] [PATCH v2 1/3] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity Stefano Stabellini
2017-05-09 19:04 ` [Qemu-devel] [PATCH v2 2/3] Check the return value of fcntl in qemu_set_cloexec Stefano Stabellini
2017-05-09 19:20 ` Eric Blake
2017-05-09 20:31 ` Greg Kurz
2017-05-11 7:55 ` Paolo Bonzini [this message]
2017-05-16 18:53 ` Stefano Stabellini
2017-05-09 19:04 ` [Qemu-devel] [PATCH v2 3/3] xen: call qemu_set_cloexec instead of fcntl Stefano Stabellini
2017-05-09 19:21 ` Eric Blake
2017-05-09 20:54 ` Greg Kurz
2017-05-09 19:20 ` [Qemu-devel] [PATCH v2 1/3] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity Eric Blake
2017-05-09 19:28 ` Eric Blake
2017-05-09 19:47 ` Stefano Stabellini
2017-05-09 20:29 ` Greg Kurz
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=a2b87b82-8ae2-20bf-dc08-aa32a8fda23f@redhat.com \
--to=pbonzini@redhat.com \
--cc=eblake@redhat.com \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xen.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).