From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH master] of: base: Fix of_get_stdoutpath() when property does not contain a colon
Date: Thu, 23 Feb 2023 11:41:36 +0100 [thread overview]
Message-ID: <20230223104136.1799426-1-ahmad@a3f.at> (raw)
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
reply other threads:[~2023-02-23 10:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230223104136.1799426-1-ahmad@a3f.at \
--to=ahmad@a3f.at \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox