Skip to contentSkip to conversation

spl: spl_imx_container: Delete uninitialized variable

PATCH Applied Fabio Estevam 2 participants 3 messages Jul 23, 2025 – Jul 24, 2025 Arm i.MX and Layerscape

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 spl: spl_imx_container: Delete uninitialized variable

From: Ye Li <[email protected]>

The 'overhead' variable is uninitialized and actually shall not be used. Delete it to fix coverity CID 37041718 - Uninitialized scalar variable.

Fixes 73c40fcb7367 ("spl: Refactor spl_load_info->read to use units of bytes")
---
 common/spl/spl_imx_container.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/spl/spl_imx_container.c +2 -2
index b3565efb225a..79d021f81dcd 100644
@@ -31,7 +31,7 @@ static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image,
 					  ulong container_offset)
 {
 	struct boot_img_t *images;
-	ulong offset, overhead, size;
+	ulong offset, size;
 	void *buf, *trampoline;
 
 	if (image_index > container->num_images) {
@@ -54,7 +54,7 @@ static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image,
 	debug("%s: container: %p offset: %lu size: %lu\n", __func__,
 	      container, offset, size);
 
-	buf = map_sysmem(images[image_index].dst - overhead, images[image_index].size);
+	buf = map_sysmem(images[image_index].dst, images[image_index].size);
 	if (IS_ENABLED(CONFIG_SPL_IMX_CONTAINER_USE_TRAMPOLINE) &&
 	    arch_check_dst_in_secure(buf, size)) {
 		trampoline = arch_get_container_trampoline();
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Fabio Estevam

From: Ye Li <[email protected]>

The 'overhead' variable is uninitialized and actually shall not be used. Delete it to fix coverity CID 37041718 - Uninitialized scalar variable.

Fixes 73c40fcb7367 ("spl: Refactor spl_load_info->read to use units of bytes")
---
  common/spl/spl_imx_container.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
common/spl/spl_imx_container.c +1 -1
index b3565efb225a..79d021f81dcd 100644
@@ -31,7 +31,7 @@ static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image,
  					  ulong container_offset)
  {
  	struct boot_img_t *images;
-	ulong offset, overhead, size;
+	ulong offset, size;
  	void *buf, *trampoline;
 
  	if (image_index > container->num_images) {

common/spl/spl_imx_container.c static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image, · line 60

Quoted 8 lines
common/spl/spl_imx_container.c +1 -1
@@ -54,7 +54,7 @@ static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image,
  	debug("%s: container: %p offset: %lu size: %lu\n", __func__,
  	      container, offset, size);
 
-	buf = map_sysmem(images[image_index].dst - overhead, images[image_index].size);
+	buf = map_sysmem(images[image_index].dst, images[image_index].size);
  	if (IS_ENABLED(CONFIG_SPL_IMX_CONTAINER_USE_TRAMPOLINE) &&
  	    arch_check_dst_in_secure(buf, size)) {
  		trampoline = arch_get_container_trampoline();
author reviewer Applied
#2 lore raw
In reply to Fabio Estevam
Quoted 11 lines · Fabio Estevam

From: Ye Li <[email protected]>

The 'overhead' variable is uninitialized and actually shall not be used. Delete it to fix coverity CID 37041718 - Uninitialized scalar variable.

Fixes 73c40fcb7367 ("spl: Refactor spl_load_info->read to use units of bytes")

Applied, thanks.