imx8: parser: fix 'end address' parameter of rm_find_memreg
authorPeng Fan <peng.fan@nxp.com>
Wed, 22 Apr 2020 07:25:31 +0000 (15:25 +0800)
committerStefano Babic <sbabic@denx.de>
Fri, 1 May 2020 11:46:21 +0000 (13:46 +0200)
parameter 'end address' must be inclusive of address range.

Modified from Seb's downstream patch.

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/mach-imx/imx8/parse-container.c

index b57e68e412495428358eae1105e9dbe6125cd1dc..e192b0c6d207de3d773c13f8ea67dec7bbca7b5d 100644 (file)
@@ -29,7 +29,7 @@ static int authenticate_image(struct boot_img_t *img, int image_index)
        /* Find the memreg and set permission for seco pt */
        err = sc_rm_find_memreg(-1, &mr,
                                img->dst & ~(CONFIG_SYS_CACHELINE_SIZE - 1),
-                               ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE));
+                               ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE) - 1);
 
        if (err) {
                printf("can't find memreg for image: %d, err %d\n",