Skip to content

Commit 6473069

Browse files
committed
block: Fix error path in bdrv_backing_update_filename()
error_setg_errno() takes a positive errno code. Spotted by Coverity (CID 1381628). Signed-off-by: Kevin Wolf <[email protected]> Reviewed-by: Alberto Garcia <[email protected]> Reviewed-by: Eric Blake <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]>
1 parent c60f6fc commit 6473069

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
998998
ret = bdrv_change_backing_file(parent, filename,
999999
base->drv ? base->drv->format_name : "");
10001000
if (ret < 0) {
1001-
error_setg_errno(errp, ret, "Could not update backing file link");
1001+
error_setg_errno(errp, -ret, "Could not update backing file link");
10021002
}
10031003

10041004
if (!(orig_flags & BDRV_O_RDWR)) {

0 commit comments

Comments
 (0)