From patchwork Mon Oct 12 12:27:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 529084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3D4A01401AD for ; Mon, 12 Oct 2015 23:29:19 +1100 (AEDT) Received: from localhost ([::1]:55044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcE8-0001Lw-S8 for incoming@patchwork.ozlabs.org; Mon, 12 Oct 2015 08:29:16 -0400 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 Received: (qmail 12413 invoked by uid 89); 12 Oct 2015 12:28:26 -0000 Received: from [82.141.1.145] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.98.7/20959. hbedv: 8.3.34.42/7.12.18.30. avast: 1.2.2/15101200. spamassassin: 3.4.0. Clear:RC:1(82.141.1.145):SA:0(-1.2/5.0):. Processed in 0.84035 secs); 12 Oct 2015 12:28:26 -0000 Received: from ns.kamp-intra.net (HELO dns.kamp-intra.net) ([82.141.1.145]) by mx01.kamp.de with SMTP; 12 Oct 2015 12:28:24 -0000 X-GL_Whitelist: yes Received: from lieven-pc (lieven-pc.kamp-intra.net [172.21.12.60]) by dns.kamp-intra.net (Postfix) with ESMTP id 94D82E0067; Mon, 12 Oct 2015 14:27:44 +0200 (CEST) Received: by lieven-pc (Postfix, from userid 1000) id 166EA2A0E2; Mon, 12 Oct 2015 14:27:31 +0200 (CEST) From: Peter Lieven To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Mon, 12 Oct 2015 14:27:23 +0200 Message-Id: <1444652845-20642-3-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444652845-20642-1-git-send-email-pl@kamp.de> References: <1444652845-20642-1-git-send-email-pl@kamp.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:248:0:51::16 Cc: kwolf@redhat.com, stefanha@gmail.com, jcody@redhat.com, jsnow@redhat.com, Peter Lieven Subject: [Qemu-devel] [PATCH 2/4] ide/atapi: blk_aio_readv may return NULL X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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: