xenpm: Initialize cputopo pointer
PATCH 1/1 xenpm: Initialize cputopo pointer
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 <[email protected]>
Reported-by Olaf Hering <[email protected]>
--- tools/misc/xenpm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
tools/misc/xenpm.c +2 -2
@@ -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;
Signature · 1 line
1.7.1
Quoted 6 lines · Boris Ostrovsky
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 <[email protected]>Reported-by Olaf Hering <[email protected]>
Acked-by Wei Liu <[email protected]>
Quoted 28 lines
--- tools/misc/xenpm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)tools/misc/xenpm.c +2
-2@@ -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;Signature · 1 line
1.7.1
Quoted 9 lines · Wei Liu
Quoted 6 lines · Boris Ostrovsky
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 <[email protected]>Reported-by Olaf Hering <[email protected]>Acked-by Wei Liu <[email protected]>
Acked + applied, thanks.