From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcDQ-0000ai-CL for qemu-devel@nongnu.org; Mon, 12 Oct 2015 08:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlcDO-0000n2-B0 for qemu-devel@nongnu.org; Mon, 12 Oct 2015 08:28:32 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:54579 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcDO-0000lV-1x for qemu-devel@nongnu.org; Mon, 12 Oct 2015 08:28:30 -0400 From: Peter Lieven Date: Mon, 12 Oct 2015 14:27:23 +0200 Message-Id: <1444652845-20642-3-git-send-email-pl@kamp.de> In-Reply-To: <1444652845-20642-1-git-send-email-pl@kamp.de> References: <1444652845-20642-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH 2/4] ide/atapi: blk_aio_readv may return NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: kwolf@redhat.com, stefanha@gmail.com, jcody@redhat.com, jsnow@redhat.com, Peter Lieven Signed-off-by: Peter Lieven --- hw/ide/atapi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 2271ea2..e0cf066 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -429,6 +429,10 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret) s->bus->dma->aiocb = blk_aio_readv(s->blk, (int64_t)s->lba << 2, &s->bus->dma->qiov, n * 4, ide_atapi_cmd_read_dma_cb, s); + if (s->bus->dma->aiocb == NULL) { + ide_atapi_io_error(s, -EIO); + goto eot; + } return; eot: -- 1.9.1