diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-04-01 22:48:44 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-04-10 00:14:23 +0200 |
commit | cb6d3ca07b8f62b47ef30c6a92caa3e8bd71248b (patch) | |
tree | 40a48a4634cc5ac2a32742be67e6c96bd65eab87 /block.c | |
parent | baf0b55a9e57b909b1f8b0f732c0b10242867418 (diff) | |
download | qemu-cb6d3ca07b8f62b47ef30c6a92caa3e8bd71248b.zip qemu-cb6d3ca07b8f62b47ef30c6a92caa3e8bd71248b.tar.gz qemu-cb6d3ca07b8f62b47ef30c6a92caa3e8bd71248b.tar.bz2 |
block: Fix multiwrite error handling
When two requests of the same multiwrite batch fail, the callback of all
requests in that batch were called twice. This could have any kind of nasty
effects, in my case it lead to use after free and eventually a segfault.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1740,7 +1740,7 @@ static void multiwrite_cb(void *opaque, int ret) { MultiwriteCB *mcb = opaque; - if (ret < 0) { + if (ret < 0 && !mcb->error) { mcb->error = ret; multiwrite_user_cb(mcb); } |