mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] of: base: Fix of_get_stdoutpath() when property does not contain a colon
@ 2023-02-23 10:41 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2023-02-23 10:41 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Initial state of patch accounted for lack of colon by skipping xstrdup
in that case. Too much time went by that I forgot before upstreaming,
 why I did it that way and thus value ended up being dropped...
 Fix this to restore console for devices which lack : in their
 stdout-path.

Fixes: 90f70dbe2958 ("of: split part of of_get_stdoutpath into of_find_node_by_chosen")
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/of/base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 34854d9b0db1..37520709fdd7 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2689,9 +2689,9 @@ struct device_node *of_find_node_by_chosen(const char *propname,
 
 	p = strchrnul(value, ':');
 	if (*p)
-		buf = xstrndup(value, p - value);
+		value = buf = xstrndup(value, p - value);
 
-	dn = of_find_node_by_path_or_alias(NULL, buf);
+	dn = of_find_node_by_path_or_alias(NULL, value);
 
 	free(buf);
 
-- 
2.38.3




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-23 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 10:41 [PATCH master] of: base: Fix of_get_stdoutpath() when property does not contain a colon Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox