From: Max Reitz <[email protected]> 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: [email protected] Signed-off-by: Max Reitz <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Signed-off-by: Kevin Wolf <[email protected]> (cherry picked from commit 01212d4ed68fc8daa29062a9a38650cf8febe392) Signed-off-by: Michael Roth <[email protected]> --- block/raw-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index d8bbed0..ef21242 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -446,6 +446,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, } if (fstat(s->fd, &st) < 0) { + ret = -errno; error_setg_errno(errp, errno, "Could not stat file"); goto fail; } -- 1.9.1
