aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi-disk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 9949786e52..792e9d045a 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -171,7 +171,9 @@ static void scsi_dma_complete(void *opaque, int ret)
scsi_req_complete(&r->req, GOOD);
done:
- scsi_req_unref(&r->req);
+ if (!r->req.io_canceled) {
+ scsi_req_unref(&r->req);
+ }
}
static void scsi_read_complete(void * opaque, int ret)