Received: from eggs.gnu.org ([2001:4830:134:3::10]:44593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0TBk-0001Ys-0o for qemu-devel@nongnu.org; Mon, 26 Mar 2018 10:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0TBf-0001dc-T7 for qemu-devel@nongnu.org; Mon, 26 Mar 2018 10:33:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36734 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0TBf-0001dI-Oq for qemu-devel@nongnu.org; Mon, 26 Mar 2018 10:33:27 -0400 References: <1520860275-101576-1-git-send-email-imammedo@redhat.com> <1520860275-101576-3-git-send-email-imammedo@redhat.com> <20180323204218.GC28161@localhost.localdomain> From: Eric Blake Message-ID: <75dc5dac-3afe-a3e2-633d-89088252d5da@redhat.com> Date: Mon, 26 Mar 2018 09:33:18 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 2/9] numa: split out NumaOptions parsing into parse_NumaOptions() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , Eduardo Habkost , Igor Mammedov Cc: peter.maydell@linaro.org, pkrempa@redhat.com, cohuck@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com, david@gibson.dropbear.id.au On 03/26/2018 03:38 AM, Laurent Vivier wrote: >>>> =C2=A0 end: >>>> +=C2=A0=C2=A0=C2=A0 if (err) { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 error_propagate(errp, er= r); >>>> +=C2=A0=C2=A0=C2=A0 } >>> >>> "if (err)" is not necessary here.=C2=A0 See >>> scripts/coccinelle/error_propagate_null.cocci. >>> >> >>>> +=C2=A0=C2=A0=C2=A0 parse_NumaOptions(ms, object, &err); >>>> + >>>> +end: >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 qapi_free_NumaOptions(object); >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (err) { >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 error_report= _err(err); >>> >>> We can fix this one too while at it. >> >> Hmm - this is the same script mentioned here: >> https://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06293.html >> >> Except that patch didn't pick up this file.=C2=A0 Why is Coccinelle no= t >> seeing this? >> >=20 > The script only catch error_propagate(), not error_report_err(). And > error_report_err() doesn't check if err is NULL. Aha - chalk it up to reviewing late in the day; I saw an 'if (err)' but=20 didn't pay close attention to what was being guarded in the two=20 different conditionals. --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org