U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Andrew Goodbody <andrew.goodbody@linaro.org>,
	Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Andrew Goodbody <andrew.goodbody@linaro.org>
Subject: Re: [PATCH v4 2/2] boot: android: Prevent use of unintialised variable
Date: Fri, 27 Jun 2025 08:52:54 +0200	[thread overview]
Message-ID: <875xghy8u1.fsf@kernel.org> (raw)
In-Reply-To: <20250625-abootimg_fix-v4-2-df7af00e87b0@linaro.org>

Hi Andrew,

Thank you for the patch.

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

> Initialise vhdr to prevent its use when uninitialised.
>
> This issue was found with Smatch.
>
> Fixes: e058176be32b (android: boot: add vendor boot image to prepare for v3, v4 support)
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---
>  boot/image-android.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/boot/image-android.c b/boot/image-android.c
> index 459cdb8456c..12bcf7e4fbd 100644
> --- a/boot/image-android.c
> +++ b/boot/image-android.c
> @@ -677,7 +677,7 @@ bool android_image_get_dtb_by_index(ulong hdr_addr, ulong vendor_boot_img,
>  {
>  	struct andr_image_data img_data;
>  	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(hdr_addr, sizeof(*hdr));
>  	if (vendor_boot_img != -1)
>
> -- 
> 2.39.5

  reply	other threads:[~2025-06-27  6:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 16:38 [PATCH v4 0/2] Prevent use of unitialised variable vhdr Andrew Goodbody
2025-06-26 16:38 ` [PATCH v4 1/2] cmd: abootimg: Prevent use of unintialised variable Andrew Goodbody
2025-06-27  6:51   ` Mattijs Korpershoek
2025-06-26 16:38 ` [PATCH v4 2/2] boot: android: " Andrew Goodbody
2025-06-27  6:52   ` Mattijs Korpershoek [this message]
2025-07-02 10:10 ` [PATCH v4 0/2] Prevent use of unitialised variable vhdr Mattijs Korpershoek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875xghy8u1.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=andrew.goodbody@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox