[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] xl: initialise rc before using it in vcpuset



On Wed, 2015-11-04 at 12:38 +0100, Dario Faggioli wrote:
> 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 = 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)...

Looks like it, a separate issue though.

Don't initialise rc to 0, add a suitable else though.

> 
> Regards,
> Dario
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.