Hi Francois,

Thank you for the patch.

On Wed, Jan 14, 2026 at 10:14, Francois Berder <[email protected]> wrote:

> If strdup call fails, one needs to free priv variable.
>
> Signed-off-by: Francois Berder <[email protected]>

Good catch! Thanks for the fix.

Reviewed-by: Mattijs Korpershoek <[email protected]>

> ---
>  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

Reply via email to