From 5a2083156c1c29abbbbd9688114aac950a5736df Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 26 Dec 2018 21:42:24 -0800 Subject: [PATCH] MLK-20663 imx8: Fix malloc issue in container parser The size used for malloc is wrong, the following read function will read 1KB to the container header buffer not the size of the header. Signed-off-by: Ye Li Acked-by: Peng Fan (cherry picked from commit cedcc6634ba143f665bf5dac3926b1b74a403479) --- arch/arm/mach-imx/imx8/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx8/parser.c b/arch/arm/mach-imx/imx8/parser.c index 998c7d669d..68cf17ed3c 100644 --- a/arch/arm/mach-imx/imx8/parser.c +++ b/arch/arm/mach-imx/imx8/parser.c @@ -158,7 +158,7 @@ static int read_auth_container(struct spl_image_info *spl_image) int ret; int i; - container = malloc(sizeof(struct container_hdr)); + container = malloc(CONTAINER_HDR_ALIGNMENT); if (!container) return -ENOMEM; -- 2.17.1