From 6584577004d094747a9b9923ed843be3621cfefc Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 14 Jan 2022 09:57:35 +0100 Subject: 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 Link: https://lore.barebox.org/20220114085735.731631-1-ahmad@a3f.at Signed-off-by: Sascha Hauer --- drivers/of/base.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- cgit v1.2.3