From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsBHN-0004X6-Ax for qemu-devel@nongnu.org; Thu, 06 Oct 2016 12:12:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsBHJ-0002yS-2c for qemu-devel@nongnu.org; Thu, 06 Oct 2016 12:12:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsBHI-0002yC-SR for qemu-devel@nongnu.org; Thu, 06 Oct 2016 12:12:12 -0400 References: <1475498477-2695-1-git-send-email-eric.auger@redhat.com> <1475498477-2695-13-git-send-email-eric.auger@redhat.com> <87r37wfffx.fsf@dusky.pond.sub.org> From: Auger Eric Message-ID: <6341df7b-834c-5070-cc21-0972cfea528c@redhat.com> Date: Thu, 6 Oct 2016 18:12:09 +0200 MIME-Version: 1.0 In-Reply-To: <87r37wfffx.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Markus Armbruster Cc: alex.williamson@redhat.com, qemu-devel@nongnu.org, eric.auger.pro@gmail.com Hi, On 04/10/2016 14:48, Markus Armbruster wrote: > 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 %-) Yes the error is severe enough to tear things down. I dared to keep it as is since the error now is reported in the Error object. Thanks Eric > > 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; >> } >> } >