summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2022-01-14 09:57:35 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-01-14 11:27:56 +0100
commit6584577004d094747a9b9923ed843be3621cfefc (patch)
treedcf6100288af823b73c10f2095a482def59e59ff
parent75bfd44939d4c38d6425c84825c4ef8c6d48356f (diff)
downloadbarebox-6584577004d094747a9b9923ed843be3621cfefc.tar.gz
barebox-6584577004d094747a9b9923ed843be3621cfefc.tar.xz
of: add trailing 0 in of_property_sprintf()
Otherwise, tools like of_dump will consider the output to be byte arrays. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220114085735.731631-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/of/base.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 06e37b0fca..80465d6d50 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2285,6 +2285,8 @@ int of_property_sprintf(struct device_node *np,
if (len < 0)
return -ENOMEM;
+ len++; /* trailing NUL */
+
pp = of_find_property(np, propname, NULL);
of_delete_property(pp);