From: "Daniel P. Berrange" <berrange@redhat.com>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] 9pfs: fail local_statfs() earlier
Date: Fri, 3 Mar 2017 18:13:29 +0000 [thread overview]
Message-ID: <20170303181329.GO13631@redhat.com> (raw)
In-Reply-To: <148856422757.9841.6298006998523421948.stgit@bahia.lan>
On Fri, Mar 03, 2017 at 07:03:47PM +0100, Greg Kurz wrote:
> If we cannot open the given path, we can return right away instead of
> passing -1 to fstatfs() and close(). This will make Coverity happy.
>
> (Coverity issue CID1371729)
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> hw/9pfs/9p-local.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
> index fe930300445a..ea9a1ced0394 100644
> --- a/hw/9pfs/9p-local.c
> +++ b/hw/9pfs/9p-local.c
> @@ -1053,6 +1053,9 @@ static int local_statfs(FsContext *s, V9fsPath *fs_path, struct statfs *stbuf)
> int fd, ret;
>
> fd = local_open_nofollow(s, fs_path->data, O_RDONLY, 0);
> + if (fd == -1) {
> + return -1;
> + }
> ret = fstatfs(fd, stbuf);
> close_preserve_errno(fd);
> return ret;
Reviewed-by: Daniel P. berrange <berrange@redhat.com>
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
next prev parent reply other threads:[~2017-03-03 18:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 18:03 [Qemu-devel] [PATCH] 9pfs: fail local_statfs() earlier Greg Kurz
2017-03-03 18:13 ` Daniel P. Berrange [this message]
2017-03-03 18:15 ` Eric Blake
2017-03-03 20:00 ` Philippe Mathieu-Daudé
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=20170303181329.GO13631@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=groug@kaod.org \
--cc=qemu-devel@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).