All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Harmandeep Kaur <write.harmandeep@gmail.com>
Subject: Re: [PATCH v2] xl: initialise rc before using it in vcpuset
Date: Wed, 4 Nov 2015 11:47:17 +0000	[thread overview]
Message-ID: <1446637637.6461.78.camel@citrix.com> (raw)
In-Reply-To: <1446637093.3829.97.camel@citrix.com>

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@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-11-04 11:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 11:32 [PATCH v2] xl: initialise rc before using it in vcpuset Wei Liu
2015-11-04 11:38 ` Dario Faggioli
2015-11-04 11:47   ` Ian Campbell [this message]
2015-11-04 11:50     ` Dario Faggioli
2015-11-04 11:39 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446637637.6461.78.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=write.harmandeep@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.