Received: from eggs.gnu.org ([2001:4830:134:3::10]:33650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwDyY-0005KN-8a for qemu-devel@nongnu.org; Mon, 17 Oct 2016 15:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwDyV-0000L3-It for qemu-devel@nongnu.org; Mon, 17 Oct 2016 15:53:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54788) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwDyV-0000Ki-Cs for qemu-devel@nongnu.org; Mon, 17 Oct 2016 15:53:31 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 9AAB0C04B927 for ; Mon, 17 Oct 2016 19:53:30 +0000 (UTC) From: Alex Williamson Date: Mon, 17 Oct 2016 13:53:29 -0600 Message-ID: <20161017195326.17307.11198.stgit@gimli.home> In-Reply-To: <20161017194945.17307.78340.stgit@gimli.home> References: <20161017194945.17307.78340.stgit@gimli.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PULL 12/19] vfio/platform: fix a wrong returned value in vfio_populate_device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eric Auger , Markus Armbruster From: Eric Auger 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 Signed-off-by: Alex Williamson --- 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; } }