[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 1/3] xen/arm: fix buf size in make_cpus_node



The size of buf is calculated wrongly: the number is 64bit, not 32bit.
Also the number is printed as a hexadecimal number, so we need 8 bytes
for 32bit, not 10 bytes.

As a result, it should be sizeof("cpu@") + 16 bytes for a 64-bit number
+ 1 byte for \0. Total = 21.

Fixes: fafd682c3e (xen/arm: Create a fake cpus node in dom0 device tree)
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
---
Changes in v2:
- patch added
---
 xen/arch/arm/domain_build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 921b054520..60923a7051 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -788,8 +788,8 @@ static int __init make_cpus_node(const struct domain *d, 
void *fdt)
     unsigned int cpu;
     const void *compatible = NULL;
     u32 len;
-    /* Placeholder for cpu@ + a 32-bit number + \0 */
-    char buf[15];
+    /* Placeholder for cpu@ + a 64-bit number + \0 */
+    char buf[21];
     u32 clock_frequency;
     bool clock_valid;
     uint64_t mpidr_aff;
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.