From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master] of: base: handle of_set_root_node(NULL) correctly
Date: Wed, 20 May 2026 17:14:26 +0300 [thread overview]
Message-ID: <CAP1tNvTpkyroMBFdeWyJ9r-5qk_GSnQ6u36x3cRUm2zG=W3GQQ@mail.gmail.com> (raw)
In-Reply-To: <20260520134923.3233562-1-a.fatoum@pengutronix.de>
Tested-by: Alexander Shiyan <eagle.alexander923@gmail.com>
ср, 20 мая 2026 г. в 16:49, Ahmad Fatoum <a.fatoum@pengutronix.de>:
>
> of_set_root_node(NULL) used to be valid and the if clause at the start
> of the function explicitly allowed of it.
>
> This was broken by the unconditional use of of_property_write_bool, so
> guard that behind the existence of a root node.
>
> Fixes: b1ced2c3caa9 ("state: suppress state overwrite warning for barebox DT")
> Reported-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> drivers/of/base.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index d4fbd2367baf..57b64bc0b96c 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -2123,15 +2123,17 @@ int of_set_root_node(struct device_node *node)
> if (node && root_node)
> return -EBUSY;
>
> root_node = node;
>
> of_chosen = of_find_node_by_path("/chosen");
> of_property_read_string(root_node, "model", &of_model);
> - of_property_write_bool(root_node, "$barebox,root-node", true);
> +
> + if (root_node)
> + of_property_write_bool(root_node, "$barebox,root-node", true);
>
> if (of_model)
> barebox_set_model(of_model);
>
> of_alias_scan();
>
> return 0;
> --
> 2.47.3
>
next prev parent reply other threads:[~2026-05-20 14:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 13:49 Ahmad Fatoum
2026-05-20 14:14 ` Alexander Shiyan [this message]
2026-05-21 8:39 ` Sascha Hauer
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='CAP1tNvTpkyroMBFdeWyJ9r-5qk_GSnQ6u36x3cRUm2zG=W3GQQ@mail.gmail.com' \
--to=eagle.alexander923@gmail.com \
--cc=a.fatoum@pengutronix.de \
--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