Skip to content

Commit

Permalink
block: Fix multiwrite memory leak in error case
Browse files Browse the repository at this point in the history
Previously multiwrite_user_cb was never called if a request in the multiwrite
batch failed right away because it did set mcb->error immediately. Make it look
more like a normal callback to fix this.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
  • Loading branch information
kevmw authored and aurel32 committed Apr 9, 2010
1 parent 0f0b604 commit 7eb58a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,8 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
reqs[i].error = -EIO;
goto fail;
} else {
mcb->error = -EIO;
mcb->num_requests++;
multiwrite_cb(mcb, -EIO);
break;
}
} else {
Expand Down

0 comments on commit 7eb58a6

Please sign in to comment.