diff options
| author | Francois Berder <[email protected]> | 2026-01-14 10:14:55 +0100 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2026-01-15 09:26:22 +0100 |
| commit | 8fa0cf5f3d7ca15e2d102d0d46a132d246793486 (patch) | |
| tree | aedb358ecc591661bd2645ec47b51c773e0fd380 /boot/bootmeth_android.c | |
| parent | 3f9765672ce424300b6d9fb95d8b01313df9dff7 (diff) | |
bootstd: android: Add missing free in android_read_bootflow
If strdup call fails, one needs to free priv variable.
Signed-off-by: Francois Berder <[email protected]>
Reviewed-by: Mattijs Korpershoek <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Link: https://lore.kernel.org/r/BESP194MB28052734FD0361EA602F6360DA8FA@BESP194MB2805.EURP194.PROD.OUTLOOK.COM
Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'boot/bootmeth_android.c')
| -rw-r--r-- | boot/bootmeth_android.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 */ |
