From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG2Go-0002LW-Gb for qemu-devel@nongnu.org; Tue, 27 Jan 2015 04:17:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YG2Gi-0003d3-IU for qemu-devel@nongnu.org; Tue, 27 Jan 2015 04:17:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG2Gi-0003cc-BH for qemu-devel@nongnu.org; Tue, 27 Jan 2015 04:17:08 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0R9H693019244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 27 Jan 2015 04:17:07 -0500 From: Fam Zheng Date: Tue, 27 Jan 2015 17:16:59 +0800 Message-Id: <1422350219-1900-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH] scsi: Fix scsi_req_cancel_async for no aiocb req List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini scsi_req_cancel_complete is responsible for releasing the request, so we shouldn't skip it in any case. This doesn't affect the only existing caller, virtio-scsi, but is useful for other devices once they use it. Suggested-by: Paolo Bonzini Signed-off-by: Fam Zheng --- hw/scsi/scsi-bus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 9b740a3..db39ae0 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -1756,6 +1756,8 @@ void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier) req->io_canceled = true; if (req->aiocb) { blk_aio_cancel_async(req->aiocb); + } else { + scsi_req_cancel_complete(req); } } -- 1.9.3