On Sat, Nov 11, 2023 at 05:08:57PM -0700, Simon Glass wrote:

> This function obtains lots of error codes and then throws them away.
> Update it to return the error, moving the image pointer to an
> argument.
> 
> Signed-off-by: Simon Glass <[email protected]>
[snip]
> @@ -217,25 +220,28 @@ static const void *boot_get_kernel(const char 
> *cmd_name, const char *addr_fit,
>                       vendor_boot_img = 
> map_sysmem(get_avendor_bootimg_addr(), 0);
>               }
>               printf("## Booting Android Image at 0x%08lx ...\n", img_addr);
> -             if (android_image_get_kernel(boot_img, vendor_boot_img, 
> images->verify,
> -                                          os_data, os_len))
> -                     return NULL;
> +             ret = android_image_get_kernel(boot_img, vendor_boot_img,
> +                                            images->verify, os_data, os_len);
> +             if (ret)
> +                     return ret;
>               if (IS_ENABLED(CONFIG_CMD_ABOOTIMG)) {
>                       unmap_sysmem(vendor_boot_img);
>                       unmap_sysmem(boot_img);
>               }

This highlights a pre-existing leak, yes? If so, can you please do a
follow-up to move if (ret) return ret; to after the unmaps? Or am I
missing something? For the patch itself:

Reviewed-by: Tom Rini <[email protected]>

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to