From 3e94cb020444ed201cfe6210f0de9953143dc74b Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 4 May 2010 14:21:00 +0200 Subject: [PATCH] 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 Signed-off-by: Anthony Liguori --- hw/scsi-disk.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.11.4.GIT