From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br2Yz-0006Dv-Gt for qemu-devel@nongnu.org; Mon, 03 Oct 2016 08:41:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1br2Yw-00072Y-Cw for qemu-devel@nongnu.org; Mon, 03 Oct 2016 08:41:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br2Yw-00072H-5k for qemu-devel@nongnu.org; Mon, 03 Oct 2016 08:41:42 -0400 From: Eric Auger Date: Mon, 3 Oct 2016 12:41:12 +0000 Message-Id: <1475498477-2695-13-git-send-email-eric.auger@redhat.com> In-Reply-To: <1475498477-2695-1-git-send-email-eric.auger@redhat.com> References: <1475498477-2695-1-git-send-email-eric.auger@redhat.com> Subject: [Qemu-devel] [PATCH v4 12/17] vfio/platform: fix a wrong returned value in vfio_populate_device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger@redhat.com, eric.auger.pro@gmail.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, armbru@redhat.com 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 --- 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; } } -- 1.9.1