From patchwork Thu Oct 6 16:07:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 9365129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0500E607D3 for ; Thu, 6 Oct 2016 16:30:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EABA729190 for ; Thu, 6 Oct 2016 16:30:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDFAE29194; Thu, 6 Oct 2016 16:30:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7A03C29190 for ; Thu, 6 Oct 2016 16:30:07 +0000 (UTC) Received: from localhost ([::1]:57795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsBYc-0002n5-KQ for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Oct 2016 12:30:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsBDP-0000eH-NM for qemu-devel@nongnu.org; Thu, 06 Oct 2016 12:08:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsBDO-0007Nb-IL for qemu-devel@nongnu.org; Thu, 06 Oct 2016 12:08:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsBDO-0007N9-Bo for qemu-devel@nongnu.org; Thu, 06 Oct 2016 12:08:10 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECF0BC01C714; Thu, 6 Oct 2016 16:08:09 +0000 (UTC) Received: from localhost.redhat.com (vpn1-4-62.ams2.redhat.com [10.36.4.62]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u96G7iwb018457; Thu, 6 Oct 2016 12:08:08 -0400 From: Eric Auger To: eric.auger@redhat.com, eric.auger.pro@gmail.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, armbru@redhat.com Date: Thu, 6 Oct 2016 16:07:33 +0000 Message-Id: <1475770058-20409-13-git-send-email-eric.auger@redhat.com> In-Reply-To: <1475770058-20409-1-git-send-email-eric.auger@redhat.com> References: <1475770058-20409-1-git-send-email-eric.auger@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 06 Oct 2016 16:08:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 12/17] vfio/platform: fix a wrong returned value in vfio_populate_device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In case the vfio_init_intp fails we currently do not return an error value. This patch fixes the bug. The returned value is not explicit but in practice the error object is the one used to report the error to the end-user and the actual returned error value is not used. Signed-off-by: Eric Auger Reviewed-by: Markus Armbruster --- --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 1a35da0..484e31f 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -508,6 +508,7 @@ static int vfio_populate_device(VFIODevice *vbasedev, Error **errp) irq.flags); intp = vfio_init_intp(vbasedev, irq, errp); if (!intp) { + ret = -1; goto irq_err; } }