Skip to content

Commit

Permalink
block: Fix error path in bdrv_backing_update_filename()
Browse files Browse the repository at this point in the history
error_setg_errno() takes a positive errno code. Spotted by Coverity
(CID 1381628).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
kevmw committed Nov 17, 2017
1 parent c60f6fc commit 6473069
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block.c
Expand Up @@ -998,7 +998,7 @@ static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
ret = bdrv_change_backing_file(parent, filename,
base->drv ? base->drv->format_name : "");
if (ret < 0) {
error_setg_errno(errp, ret, "Could not update backing file link");
error_setg_errno(errp, -ret, "Could not update backing file link");
}

if (!(orig_flags & BDRV_O_RDWR)) {
Expand Down

0 comments on commit 6473069

Please sign in to comment.