From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Francois Berder <fberder@outlook.fr>, u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] bootstd: android: Add missing free in android_read_bootflow
Date: Thu, 15 Jan 2026 09:23:58 +0100 [thread overview]
Message-ID: <87bjivffmp.fsf@kernel.org> (raw)
In-Reply-To: <BESP194MB28052734FD0361EA602F6360DA8FA@BESP194MB2805.EURP194.PROD.OUTLOOK.COM>
Hi Francois,
Thank you for the patch.
On Wed, Jan 14, 2026 at 10:14, Francois Berder <fberder@outlook.fr> wrote:
> If strdup call fails, one needs to free priv variable.
>
> Signed-off-by: Francois Berder <fberder@outlook.fr>
Good catch! Thanks for the fix.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> boot/bootmeth_android.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c
> index 1374551dbeb..1d70e8d5c05 100644
> --- a/boot/bootmeth_android.c
> +++ b/boot/bootmeth_android.c
> @@ -252,8 +252,10 @@ static int android_read_bootflow(struct udevice *dev, struct bootflow *bflow)
> priv->boot_mode = ANDROID_BOOT_MODE_NORMAL;
> bflow->os_name = strdup("Android");
> }
> - if (!bflow->os_name)
> + if (!bflow->os_name) {
> + free(priv);
> return log_msg_ret("os", -ENOMEM);
> + }
>
> if (priv->boot_mode == ANDROID_BOOT_MODE_BOOTLOADER) {
> /* Clear BCB */
> --
> 2.43.0
next prev parent reply other threads:[~2026-01-15 8:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 9:14 [PATCH] bootstd: android: Add missing free in android_read_bootflow Francois Berder
2026-01-14 14:47 ` Tom Rini
2026-01-15 8:23 ` Mattijs Korpershoek [this message]
2026-01-15 8:26 ` 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=87bjivffmp.fsf@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=fberder@outlook.fr \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.