[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/3] Check the return value of fcntl in qemu_
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/3] Check the return value of fcntl in qemu_set_cloexec |
Date: |
Tue, 16 May 2017 11:53:11 -0700 (PDT) |
User-agent: |
Alpine 2.10 (DEB 1266 2009-07-14) |
On Thu, 11 May 2017, Paolo Bonzini wrote:
> 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 <address@hidden>
> > CC: address@hidden
> > CC: address@hidden
> > CC: Eric Blake <address@hidden>
>
> Queued, thanks.
I am about to send a pull request with the rest of the series, but I'll
leave this one to you.
Cheers,
Stefano
> > ---
> > 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);
> > }
> >
> > /*
> >
>
- [Qemu-devel] [PATCH v2 1/3] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity, Stefano Stabellini, 2017/05/09
- [Qemu-devel] [PATCH v2 2/3] Check the return value of fcntl in qemu_set_cloexec, Stefano Stabellini, 2017/05/09
- [Qemu-devel] [PATCH v2 3/3] xen: call qemu_set_cloexec instead of fcntl, Stefano Stabellini, 2017/05/09
- Re: [Qemu-devel] [PATCH v2 1/3] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity, Eric Blake, 2017/05/09
- Re: [Qemu-devel] [PATCH v2 1/3] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity, Greg Kurz, 2017/05/09