All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bootstd: android: Add missing free in android_read_bootflow
@ 2026-01-14  9:14 Francois Berder
  2026-01-14 14:47 ` Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Francois Berder @ 2026-01-14  9:14 UTC (permalink / raw)
  To: u-boot; +Cc: Simon Glass, Mattijs Korpershoek, Tom Rini

If strdup call fails, one needs to free priv variable.

Signed-off-by: Francois Berder <fberder@outlook.fr>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-15  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-01-15  8:26 ` Mattijs Korpershoek

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.