From: Wei Liu Subject: Re: [PATCH] xenpm: Initialize cputopo pointer Date: Thu, 14 May 2015 04:02:12 +0100 Message-ID: <20150514030212.GB12262@zion.uk.xensource.com> References: <1431538655-15662-1-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1431538655-15662-1-git-send-email-boris.ostrovsky@oracle.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: Boris Ostrovsky Cc: olaf@aepfle.de, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, May 13, 2015 at 01:37:35PM -0400, Boris Ostrovsky wrote: > Commit 250f0b43af1a ("libxl/libxc: Move libxl_get_cpu_topology()'s > hypercall buffer management to libxc") broke non-debug compilation: > on error path we may have uninitialized cputopo pointer. > > Signed-off-by: Boris Ostrovsky > Reported-by: Olaf Hering Acked-by: Wei Liu > --- > tools/misc/xenpm.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c > index 24ee6ef..fe2c001 100644 > --- a/tools/misc/xenpm.c > +++ b/tools/misc/xenpm.c > @@ -355,7 +355,7 @@ static void signal_int_handler(int signo) > int i, j, k; > struct timeval tv; > int cx_cap = 0, px_cap = 0; > - xc_cputopo_t *cputopo; > + xc_cputopo_t *cputopo = NULL; > unsigned max_cpus; > > if ( xc_cputopoinfo(xc_handle, &max_cpus, NULL) != 0 ) > @@ -960,7 +960,7 @@ void scaling_governor_func(int argc, char *argv[]) > > void cpu_topology_func(int argc, char *argv[]) > { > - xc_cputopo_t *cputopo; > + xc_cputopo_t *cputopo = NULL; > unsigned max_cpus; > int i, rc; > > -- > 1.7.1