[PATCH 12/29] bootm: Adjust boot_get_kernel() to return an error

Tom Rini trini at konsulko.com
Wed Nov 15 23:36:51 CET 2023


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 <sjg at chromium.org>
[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 <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231115/482781e8/attachment.sig>


More information about the U-Boot mailing list