libxl: initialise nr_dom_vcpus to fix 4a6070ea9
PATCH v2 1/1 libxl: initialise nr_dom_vcpus to fix 4a6070ea9
Clang complains nr_dom_vcpus may be used uninitialised after 4a6070ea9.
The real issue is vinfo can be NULL and nr_dom_vcpus remains uninitialised if previous call fails.
Initialise nr_dom_vcpus to 0 at the beginning of the loop to fix the issue.
---
Cc: Ian Jackson <[email protected]>
Cc: Dario Faggioli <[email protected]>
Cc: Juergen Gross <[email protected]>
--- tools/libxl/libxl_numa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxl/libxl_numa.c +2 -1
@@ -206,8 +206,9 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,for (i =0 ; i < nr_doms; i++) {libxl_vcpuinfo *vinfo =NULL ; +int nr_dom_vcpus =0 ;libxl_cpupoolinfo cpupool_info; -int cpupool, nr_dom_vcpus; +int cpupool;libxl_cpupoolinfo_init (&cpupool_info);
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 11 lines · Wei Liu
Clang complains
nr_dom_vcpusmay be used uninitialised after4a6070ea9.The real issue is vinfo can be NULL and
nr_dom_vcpusremains uninitialised if previous call fails.Initialise
nr_dom_vcpusto 0 at the beginning of the loop to fix the issue.Signed-off-by Wei Liu <[email protected]>
Thanks and Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Wei Liu writes ("[PATCH v2] libxl: initialise nr_dom_vcpus to fix 4a6070ea9"):
Quoted 8 lines
Clang complains
nr_dom_vcpusmay be used uninitialised after4a6070ea9.The real issue is vinfo can be NULL and
nr_dom_vcpusremains uninitialised if previous call fails.Initialise
nr_dom_vcpusto 0 at the beginning of the loop to fix the issue.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel