Skip to content

Commit

Permalink
block/raw-posix: Fix ret in raw_open_common()
Browse files Browse the repository at this point in the history
The return value must be negative on error; there is one place in
raw_open_common() where errp is set, but ret remains 0. Fix it.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 01212d4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
XanClic authored and mdroth committed Jan 14, 2015
1 parent 178ed9a commit 6bbb939
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/raw-posix.c
Expand Up @@ -447,6 +447,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
s->has_write_zeroes = true;

if (fstat(s->fd, &st) < 0) {
ret = -errno;
error_setg_errno(errp, errno, "Could not stat file");
goto fail;
}
Expand Down

0 comments on commit 6bbb939

Please sign in to comment.