[PATCH v2 05/23] mci: imx-esdhc-pbl: fix number of read blocks

Marco Felsch m.felsch at pengutronix.de
Mon Mar 13 06:41:44 PDT 2023


We correctly calculate the buffer offset via the ofs variable by taking
the offset and the header-entry into account but the actual read is
missing this. Fix this by replace the static offset variable with the
ofs variable.

Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
 drivers/mci/imx-esdhc-pbl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/imx-esdhc-pbl.c b/drivers/mci/imx-esdhc-pbl.c
index 40c2882dc4..0b6ab9b5d0 100644
--- a/drivers/mci/imx-esdhc-pbl.c
+++ b/drivers/mci/imx-esdhc-pbl.c
@@ -199,7 +199,7 @@ esdhc_load_image(struct fsl_esdhc_host *host, ptrdiff_t address,
 		buf = (void *)(entry - ofs);
 	}
 
-	ret = esdhc_read_blocks(host, buf, offset + len);
+	ret = esdhc_read_blocks(host, buf, ofs + len);
 	if (ret) {
 		pr_err("Loading image failed with %d\n", ret);
 		return ret;

-- 
2.30.2




More information about the barebox mailing list