Skip to contentSkip to conversation

correct indexing in xc_cpu_to_node_t map

PATCH New beth kon 1 participant 1 message Aug 17, 2007 Arm/actions semi architecture

lore
Share & tools
lore

beth kon

author
#0 lore raw

PATCH 1/1 correct indexing in xc_cpu_to_node_t map

Looks like there is a nit with initilizing the map array. It needs one more element than MAX_CPU_ID since indexing starts at 0.

tools/python/xen/lowlevel/xc/xc.c Fri Aug 17 15:44:22 2007 -0400 renamed from tools/python/xen/lowlevel/xc/xc.c Thu Aug 16 13:27:59 2007 +0100 +1 -1
diff -r 256160ff19b7 tools/python/xen/lowlevel/xc/xc.c
@@ -685,7 +685,7 @@ static PyObject *pyxc_physinfo(XcObject
    char cpu_cap[128], *p=cpu_cap, *q=cpu_cap;
    int i, j, max_cpu_id;
    PyObject *ret_obj, *node_to_cpu_obj;
-    xc_cpu_to_node_t map[MAX_CPU_ID];
+    xc_cpu_to_node_t map[MAX_CPU_ID + 1];
 
    set_xen_guest_handle(info.cpu_to_node, map);
    info.max_cpu_id = MAX_CPU_ID;
Signature · 4 lines
Elizabeth Kon (Beth)
IBM Linux Technology Center
Open Hypervisor Team
email: [email protected]