From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] libxl: only free vcpu info list when it is allocated Date: Fri, 21 Oct 2016 19:26:16 +0200 Message-ID: <1477070776.24930.145.camel@citrix.com> References: <1477070247-32185-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0242391416134929565==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxdaR-0000k0-1n for xen-devel@lists.xenproject.org; Fri, 21 Oct 2016 17:26:31 +0000 In-Reply-To: <1477070247-32185-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu , Xen-devel Cc: Juergen Gross , Ian Jackson List-Id: xen-devel@lists.xenproject.org --===============0242391416134929565== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-sOQ7dH5d/WmhavT8cOVV" --=-sOQ7dH5d/WmhavT8cOVV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2016-10-21 at 18:17 +0100, Wei Liu wrote: > Clang complains nr_dom_vcpus may be used uninitialized after > 4a6070ea9. >=20 > The real issue is vinfo can be NULL and nr_dom_vcpus remains > uninitialized if previous call fails. >=20 If it were me doing this, I'd just have initialized nr_dom_vcpus to 0. This is what I've always done when using=C2=A0libxl_numainfo_list_free(), which is similar to this (then how did I miss doing it here? Oh, well... :-/) And since we're initializing vinfo to NULL already, initializing nr_dom_vcpus as well makes things look more uniform. That being said, this amounts to personal taste, you're the maintainer, and it's not that I can't stand this solution, so: > Signed-off-by: Wei Liu > Reviewed-by: Dario Faggioli Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-sOQ7dH5d/WmhavT8cOVV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJYCk+5AAoJEBZCeImluHPusZgP/25Wk7NDQl0Lt1MvuteTSp8p a+0dfsRCYpD9pf8flw/yLgzkibSdy5wddZ8y5JG7c29eA5tYpzNbnT4UglKk5Y5Y 9TTKwywMxNmw+sZeW83EYF1TaS0LkxnYOGaGCXdD0KvX92JupdpGDXYv2kBbN8P+ KBC7Gkrjb5IaswLzBarJHXAhp8lkLU6TYB0/xjrnaL42owjHPtIYt3Eioid8nijq wZXltRdRmGdXoQWZZEbAwsHIImypjQ6TPfc1ksH/vT3Fi4fzT/1kLRHka+TsV5mK Enz8D9hAcRaLU9PchAY8dJgiFSnFOJ42eV3JZe4hscqWy5bco3HGvoBcolA9uhVf y+KM+X/bSrPKURbiU+kNtD/OSaZxF9/3gpSnmKIL/GyQliVxY3qiVmxVMREmxIGt YrbT3IetT//u8AXtCcdFI70eWEytTkZ4/wt0rClrQyHuT1/eLGjJ7zN34sKWNtWA Vndgb8SAT1SLKFz9sKQj3Pul6SdH0ZxzxrcW8c29HJcGVQW4Xb3TY4NA7MX5IkKb sLDCmedbMUD1Lfukb5Oej91sAf5qtr+JPtWVPQpon8Xla+9lOEzW9V8lxKYboxI+ ZeyEAA2lnsqUBJYtNkWXcaLI4Ld4DbRzE2MzHHcnrakq8gGEmCIXJO9uXlCu3NuG 5s45ty+HSELem7mRh57a =ydKq -----END PGP SIGNATURE----- --=-sOQ7dH5d/WmhavT8cOVV-- --===============0242391416134929565== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============0242391416134929565==--