Re: [Qemu-devel] [PATCH] Fix issues affecting Xen 9pfs discovered by Coverity

2017-05-09 Thread Greg Kurz
On Mon, 8 May 2017 17:05:01 -0500 Eric Blake wrote: > On 05/08/2017 05:00 PM, Stefano Stabellini wrote: > > >>> Directly calling fcntl(F_SETFD) without first reading fcntl(F_GETFD) is > >>> (theoretically) incorrect. Better might be using qemu_set_cloexec() > >>> instead of

Re: [Qemu-devel] [PATCH] Fix issues affecting Xen 9pfs discovered by Coverity

2017-05-08 Thread Eric Blake
On 05/08/2017 05:00 PM, Stefano Stabellini wrote: >>> Directly calling fcntl(F_SETFD) without first reading fcntl(F_GETFD) is >>> (theoretically) incorrect. Better might be using qemu_set_cloexec() >>> instead of open-coding something. >> >> Makes sense but the unchecked return of fcntl,

Re: [Qemu-devel] [PATCH] Fix issues affecting Xen 9pfs discovered by Coverity

2017-05-08 Thread Stefano Stabellini
On Mon, 8 May 2017, Stefano Stabellini wrote: > On Mon, 8 May 2017, Eric Blake wrote: > > On 05/08/2017 03:45 PM, Stefano Stabellini wrote: > > > Fix two resource leaks on error paths, discovered by Coverity. > > > Check for errors returned by fcntl, also found by Coverity. > > > > > >

Re: [Qemu-devel] [PATCH] Fix issues affecting Xen 9pfs discovered by Coverity

2017-05-08 Thread Stefano Stabellini
On Mon, 8 May 2017, Eric Blake wrote: > On 05/08/2017 03:45 PM, Stefano Stabellini wrote: > > Fix two resource leaks on error paths, discovered by Coverity. > > Check for errors returned by fcntl, also found by Coverity. > > > > CID:1374836 > > CID:1374831 > > > > > @@ -378,7 +380,10 @@ static

Re: [Qemu-devel] [PATCH] Fix issues affecting Xen 9pfs discovered by Coverity

2017-05-08 Thread Eric Blake
On 05/08/2017 03:45 PM, Stefano Stabellini wrote: > Fix two resource leaks on error paths, discovered by Coverity. > Check for errors returned by fcntl, also found by Coverity. > > CID:1374836 > CID:1374831 > > @@ -378,7 +380,10 @@ static int xen_9pfs_connect(struct XenDevice *xendev) >

[Qemu-devel] [PATCH] Fix issues affecting Xen 9pfs discovered by Coverity

2017-05-08 Thread Stefano Stabellini
Fix two resource leaks on error paths, discovered by Coverity. Check for errors returned by fcntl, also found by Coverity. CID:1374836 CID:1374831 Signed-off-by: Stefano Stabellini diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index 9c7f41a..f75e728