diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-06-26 17:38:55 +0100 |
---|---|---|
committer | Mattijs Korpershoek <mkorpershoek@kernel.org> | 2025-07-02 12:10:25 +0200 |
commit | 4b489f517366595cd3f003d4175e721bd927a18b (patch) | |
tree | 3769f1d87bbb490b17f2d1b7dbbf67ac2a64dabf /boot/image-android.c | |
parent | 4b9717c6868f2f98b02fbe87a885cfa48a5b9946 (diff) |
boot: android: Prevent use of unintialised variable
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>
Link: https://lore.kernel.org/r/20250625-abootimg_fix-v4-2-df7af00e87b0@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Diffstat (limited to 'boot/image-android.c')
-rw-r--r-- | boot/image-android.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/boot/image-android.c b/boot/image-android.c index 14cf611cee5..1cd2060bb3f 100644 --- a/boot/image-android.c +++ b/boot/image-android.c @@ -680,7 +680,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) |