From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brP8z-0004c4-31 for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:48:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brP8v-0004sI-Mz for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:48:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brP8v-0004rZ-GJ for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:48:21 -0400 From: Markus Armbruster References: <1475498477-2695-1-git-send-email-eric.auger@redhat.com> <1475498477-2695-13-git-send-email-eric.auger@redhat.com> Date: Tue, 04 Oct 2016 14:48:18 +0200 In-Reply-To: <1475498477-2695-13-git-send-email-eric.auger@redhat.com> (Eric Auger's message of "Mon, 3 Oct 2016 12:41:12 +0000") Message-ID: <87r37wfffx.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [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 Cc: eric.auger.pro@gmail.com, qemu-devel@nongnu.org, alex.williamson@redhat.com Eric Auger writes: > 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. The function's contract permits this by neglecting to say anything about the return value %-) The callers don't actually care about the value. > 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; > } > }