From: Xiang W <wxjstz@126.com>
To: "Manuel Hernández Méndez" <maherme.dev@gmail.com>,
opensbi@lists.infradead.org
Subject: Re: [PATCH] platform: openpiton: fix uninitialized plic_data struct
Date: Wed, 09 Jul 2025 19:46:46 +0800 [thread overview]
Message-ID: <4e1bdd5521fd09e6ebecc3f0fa93a74979801678.camel@126.com> (raw)
In-Reply-To: <20250708180914.1131-1-maherme.dev@gmail.com>
在 2025-07-08二的 20:09 +0200,Manuel Hernández Méndez写道:
> The plic_data struct was uninitialized. This led to misfunction behavior
> since it was subsequently assigned to the global plic struct, and some
> struct fields, such as flags and irqchip, contained random values.
> The fix proposes to initialize the plic_data to the global plic struct,
> so, after parsing the fdt, the fields of the struct will be set to the
> default values set in global plic struct definition, or the parsed values
> in the fdt, or zero.
>
> Fixes: 4c37451 ("platform: openpiton: Read the device configurations from
> device tree")
> Signed-off-by: Manuel Hernández Méndez <maherme.dev@gmail.com>
LGTM
Reviewed-by: Xiang W <wxjstz@126.com>
> ---
> platform/fpga/openpiton/platform.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/platform/fpga/openpiton/platform.c b/platform/fpga/openpiton/platform.c
> index d2cf3e32..faa299ce 100644
> --- a/platform/fpga/openpiton/platform.c
> +++ b/platform/fpga/openpiton/platform.c
> @@ -79,7 +79,7 @@ static int openpiton_early_init(bool cold_boot)
> {
> const void *fdt;
> struct platform_uart_data uart_data = { 0 };
> - struct plic_data plic_data;
> + struct plic_data plic_data = plic;
> unsigned long aclint_freq;
> uint64_t clint_addr;
> int rc;
> --
> 2.34.1
>
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next prev parent reply other threads:[~2025-07-09 14:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 18:09 [PATCH] platform: openpiton: fix uninitialized plic_data struct Manuel Hernández Méndez
2025-07-09 6:04 ` Xiang W
2025-07-09 8:33 ` Manuel Hernández Méndez
2025-07-09 11:45 ` Xiang W
2025-07-09 11:46 ` Xiang W [this message]
2025-07-22 10:36 ` Anup Patel
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=4e1bdd5521fd09e6ebecc3f0fa93a74979801678.camel@126.com \
--to=wxjstz@126.com \
--cc=maherme.dev@gmail.com \
--cc=opensbi@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