aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-05-04 14:21:00 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-05-10 11:36:03 -0500
commit3e94cb020444ed201cfe6210f0de9953143dc74b (patch)
tree38f341d02247cd33825ab8c448437fe3ada4de62 /hw/scsi-disk.c
parente9447f35718439c1affdee3ef69b2fee50c8106c (diff)
scsi-disk: Clear aiocb on read completion
Once the I/O completion callback returned, aiocb will be released by the controller. So we have to clear the reference not only in scsi_write_complete, but also in scsi_read_complete. Otherwise we risk inconsistencies when a reset hits us before the related request is released. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r--hw/scsi-disk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index b8d805fb51..4d209197ce 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -125,6 +125,8 @@ static void scsi_read_complete(void * opaque, int ret)
{
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
+ r->req.aiocb = NULL;
+
if (ret) {
DPRINTF("IO error\n");
r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, 0);