From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v2] xl: initialise rc before using it in vcpuset Date: Wed, 4 Nov 2015 12:38:13 +0100 Message-ID: <1446637093.3829.97.camel@citrix.com> References: <1446636777-31896-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5233150083000019862==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZtwOY-0004tN-MU for xen-devel@lists.xenproject.org; Wed, 04 Nov 2015 11:38:26 +0000 In-Reply-To: <1446636777-31896-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu , Xen-devel Cc: Andrew Cooper , Ian Jackson , Ian Campbell , Harmandeep Kaur List-Id: xen-devel@lists.xenproject.org --===============5233150083000019862== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-eJbqLx1rgyyRdjH/Z/rW" --=-eJbqLx1rgyyRdjH/Z/rW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-11-04 at 11:32 +0000, Wei Liu wrote: > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index 2756d2f..9b6b42c 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -5473,7 +5473,8 @@ static int vcpuset(uint32_t domid, const char* > nr_vcpus, int check_host) > if (rc) > return 1; > } > - if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) { > + rc =3D libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus); > + if (rc) { > fprintf(stderr, "libxl_cpu_bitmap_alloc failed, rc: %d\n", > rc); > return 1; > } > Don't we also need to initialise rc to 0? It seems to me that it may be used uninitialised also inside of if(check_host)... Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-eJbqLx1rgyyRdjH/Z/rW 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 v1 iEYEABECAAYFAlY57iUACgkQk4XaBE3IOsQ3IQCfQoVT8tP9aOpC8fTDRRjyS3Fd DLoAn3CZvGuHnqxrj31cGOKnuutAAuPj =zjNA -----END PGP SIGNATURE----- --=-eJbqLx1rgyyRdjH/Z/rW-- --===============5233150083000019862== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5233150083000019862==--