Skip to content
Snippets Groups Projects
Commit 2795ecf6 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

qcow2: Fix return value of alloc_refcount_block


Someone forgot something in commit 29c1a730... Documenting the right
return value is not enough, you also need to actually return it in the
code.

This bug sometimes causes error return values even when everything has
succeeded: The new offset of the refcount block is truncated to 32 bits
and interpreted as signed. At least with small cluster sizes it's easy
to get a negative return value this way.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 8dc0a5e7
No related branches found
No related tags found
No related merge requests found
......@@ -400,7 +400,7 @@ static int alloc_refcount_block(BlockDriverState *bs,
return ret;
}
return new_block;
return 0;
fail_table:
g_free(new_table);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment