From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: "Vincent Stehlé" <vincent.stehle@arm.com>, u-boot@lists.denx.de
Cc: "Vincent Stehlé" <vincent.stehle@arm.com>,
"Jassi Brar" <jaswinder.singh@linaro.org>,
"Marek Vasut" <marex@denx.de>,
"Masahisa Kojima" <kojima.masahisa@socionext.com>,
"Michal Simek" <michal.simek@amd.com>,
"Patrice Chotard" <patrice.chotard@foss.st.com>,
"Patrick Delaunay" <patrick.delaunay@foss.st.com>,
"Tom Rini" <trini@konsulko.com>,
uboot-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH 2/5] board: st: common: fix dfu alt buffer clearing
Date: Mon, 14 Apr 2025 14:24:32 +0200 [thread overview]
Message-ID: <87plhfc4n3.fsf@kernel.org> (raw)
In-Reply-To: <20250407170529.893307-3-vincent.stehle@arm.com>
Hi Vincent,
Thank you for the patch.
On lun., avril 07, 2025 at 19:05, Vincent Stehlé <vincent.stehle@arm.com> wrote:
> The set_dfu_alt_info() function calls the ALLOC_CACHE_ALIGN_BUFFER()
> macro to declare a `buf' variable pointer into an array allocated on the
> stack. It then calls the memset() function to clear the useable portion
> of the array using the idiomatic expression `sizeof(buf)'.
>
> While this would indeed work fine for an array, in the present case we
> end up clearing only the size of a pointer.
> Fix this by specifying the explicit size `DFU_ALT_BUF_LEN' instead.
>
> Fixes: ec2933e543df ("board: stm32mp1: move set_dfu_alt_info in st common directory")
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> board/st/common/stm32mp_dfu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
> index 1db8e45480e..8c1f80b678a 100644
> --- a/board/st/common/stm32mp_dfu.c
> +++ b/board/st/common/stm32mp_dfu.c
> @@ -105,7 +105,7 @@ void set_dfu_alt_info(char *interface, char *devstr)
> if (env_get("dfu_alt_info"))
> return;
>
> - memset(buf, 0, sizeof(buf));
> + memset(buf, 0, DFU_ALT_BUF_LEN);
>
> snprintf(buf, DFU_ALT_BUF_LEN,
> "ram 0=%s", CONFIG_DFU_ALT_RAM0);
> --
> 2.47.2
next prev parent reply other threads:[~2025-04-14 12:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 17:05 [PATCH 0/5] fix dfu alt buffer clearing Vincent Stehlé
2025-04-07 17:05 ` [PATCH 1/5] fwu: developerbox: " Vincent Stehlé
2025-04-14 12:22 ` Mattijs Korpershoek
2025-04-07 17:05 ` [PATCH 2/5] board: st: common: " Vincent Stehlé
2025-04-14 12:24 ` Mattijs Korpershoek [this message]
2025-04-14 12:35 ` Mattijs Korpershoek
2025-04-22 7:32 ` Patrice CHOTARD
2025-05-05 13:28 ` Patrice CHOTARD
2025-04-07 17:05 ` [PATCH 3/5] arm64: versal: " Vincent Stehlé
2025-04-11 3:56 ` Begari, Padmarao
2025-04-14 6:28 ` Michal Simek
2025-04-07 17:05 ` [PATCH 4/5] xilinx: zynq: " Vincent Stehlé
2025-04-11 3:57 ` Begari, Padmarao
2025-04-14 6:28 ` Michal Simek
2025-04-07 17:05 ` [PATCH 5/5] arm64: zynqmp: " Vincent Stehlé
2025-04-11 3:57 ` Begari, Padmarao
2025-04-14 6:29 ` Michal Simek
2025-04-23 7:53 ` (subset) [PATCH 0/5] " Mattijs Korpershoek
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=87plhfc4n3.fsf@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=jaswinder.singh@linaro.org \
--cc=kojima.masahisa@socionext.com \
--cc=marex@denx.de \
--cc=michal.simek@amd.com \
--cc=patrice.chotard@foss.st.com \
--cc=patrick.delaunay@foss.st.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-stm32@st-md-mailman.stormreply.com \
--cc=vincent.stehle@arm.com \
/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