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 <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
{
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);