[PATCH v4 1/2] cmd: abootimg: Prevent use of unintialised variable

Mattijs Korpershoek mkorpershoek at kernel.org
Fri Jun 27 08:51:08 CEST 2025


Hi Andrew,

Thank you for the patch.

On Thu, Jun 26, 2025 at 17:38, Andrew Goodbody <andrew.goodbody at linaro.org> wrote:

> Initiaise vhdr to prevent its use when uninitialised.

s/Initiaise/Initialise/: will fix when applying.

>
> This issue was found with Smatch.
>
> Fixes: 636da2039aea (android: boot: support boot image header version 3 and 4)
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
> ---
>  cmd/abootimg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/abootimg.c b/cmd/abootimg.c
> index ae7a1a7c83b..9ae87581d2c 100644
> --- a/cmd/abootimg.c
> +++ b/cmd/abootimg.c
> @@ -95,7 +95,7 @@ static int abootimg_get_dtb_load_addr(int argc, char *const argv[])
>  		return CMD_RET_USAGE;
>  	struct andr_image_data img_data = {0};
>  	const struct andr_boot_img_hdr_v0 *hdr;
> -	const struct andr_vnd_boot_img_hdr *vhdr;
> +	const struct andr_vnd_boot_img_hdr *vhdr = NULL;
>  
>  	hdr = map_sysmem(abootimg_addr(), sizeof(*hdr));
>  	if (get_avendor_bootimg_addr() != -1)
>
> -- 
> 2.39.5


More information about the U-Boot mailing list