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:50:03 +0100 Message-ID: <1446637803.3829.99.camel@citrix.com> References: <1446636777-31896-1-git-send-email-wei.liu2@citrix.com> <1446637093.3829.97.camel@citrix.com> <1446637637.6461.78.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6499518701946608418==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZtwZt-00060G-7T for xen-devel@lists.xenproject.org; Wed, 04 Nov 2015 11:50:09 +0000 In-Reply-To: <1446637637.6461.78.camel@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: Ian Campbell , Wei Liu , Xen-devel Cc: Andrew Cooper , Ian Jackson , Harmandeep Kaur List-Id: xen-devel@lists.xenproject.org --===============6499518701946608418== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-aWheTJEWri+se/9/t2VW" --=-aWheTJEWri+se/9/t2VW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-11-04 at 11:47 +0000, Ian Campbell wrote: > On Wed, 2015-11-04 at 12:38 +0100, Dario Faggioli wrote: > > On Wed, 2015-11-04 at 11:32 +0000, Wei Liu wrote: > >=20 > > > 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; > > > } > > >=20 > > 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)... >=20 > Looks like it, a separate issue though. >=20 The compiler is not spotting it again, though (just as a side note). > Don't initialise rc to 0, add a suitable else though. >=20 Yeah, sure, I figured that out after having sent the mail. I'll send a patch. Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-aWheTJEWri+se/9/t2VW 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 iEYEABECAAYFAlY58OsACgkQk4XaBE3IOsS+mACaA5rw+Zc66S1zqXQ5gBfBVXg5 CKgAnAhLJ3Y76bM1BXjyq3rKzN2fEWfW =ZKg8 -----END PGP SIGNATURE----- --=-aWheTJEWri+se/9/t2VW-- --===============6499518701946608418== 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 --===============6499518701946608418==--