of: Fix of platform build on powerpc due to bad of disaply code
Commit Message
The commit 2d681d6a23a1 ("of: Make of framebuffer devices unique")
breaks build because of wrong argument to snprintf. That certainly
avoids the runtime error but is not the intended outcome.
Fixes: 2d681d6a23a1 ("of: Make of framebuffer devices unique")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
drivers/of/platform.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -564,10 +564,10 @@ static int __init of_platform_default_populate_init(void)
}
for_each_node_by_type(node, "display") {
- char *buf[14];
+ char buf[14];
if (!of_get_property(node, "linux,opened", NULL) || node == boot_display)
continue;
- ret = snprintf(buf, "of-display-%d", display_number++);
+ ret = snprintf(buf, sizeof(buf), "of-display-%d", display_number++);
if (ret >= sizeof(buf))
continue;
of_platform_device_create(node, buf, NULL);