spl: spl_imx_container: Delete uninitialized variable
Fabio Estevam
reviewerPATCH 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")
Reported-by Andrew Goodbody <[email protected]>
Signed-off-by Ye Li <[email protected]>
Reviewed-by Peng Fan <[email protected]>
Signed-off-by Fabio Estevam <[email protected]>
--- common/spl/spl_imx_container.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
common/spl/spl_imx_container.c +2 -2
@@ -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
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")Reported-by Andrew Goodbody <[email protected]>Signed-off-by Ye Li <[email protected]>Reviewed-by Peng Fan <[email protected]>Signed-off-by Fabio Estevam <[email protected]>--- common/spl/spl_imx_container.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)common/spl/spl_imx_container.c +1
-1@@ -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 ();
Reviewed-by Andrew Goodbody <[email protected]>
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")Reported-by Andrew Goodbody <[email protected]>Signed-off-by Ye Li <[email protected]>Reviewed-by Peng Fan <[email protected]>Signed-off-by Fabio Estevam <[email protected]>
Applied, thanks.