diff options
| author | Dai Okamura <[email protected]> | 2022-12-09 20:40:21 +0900 |
|---|---|---|
| committer | Dario Binacchi <[email protected]> | 2022-12-10 14:35:55 +0100 |
| commit | fda2253d121f05921e419edffe615c607917792a (patch) | |
| tree | 2bad16f7baf7283e4d8af9c11ad8ef89dd217ecb /common/spl | |
| parent | 17c2ccde22c7374df452db057b185b4c9f9b6bd0 (diff) | |
spl: spl_legacy: fix invalid offset in SPL_COPY_PAYLOAD_ONLY
This fixes the header offset calculation.
This issue was found on uniphier v7 SoCs with SPL.
Fixes: 06377c5a1f ("spl: spl_legacy: Fix NAND boot on OMAP3 BeagleBoard")
Signed-off-by: Dai Okamura <[email protected]>
Reviewed-By: Michael Trimarchi <[email protected]>
Acked-by: Michael Trimarchi <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Signed-off-by: Dario Binacchi <[email protected]>
Diffstat (limited to 'common/spl')
| -rw-r--r-- | common/spl/spl_legacy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c index 4c7f44687e8..16851c55eb5 100644 --- a/common/spl/spl_legacy.c +++ b/common/spl/spl_legacy.c @@ -106,7 +106,7 @@ int spl_load_legacy_img(struct spl_image_info *spl_image, * is set */ if (spl_image->flags & SPL_COPY_PAYLOAD_ONLY) - dataptr += sizeof(hdr); + dataptr += sizeof(*hdr); load->read(load, dataptr, spl_image->size, (void *)(unsigned long)spl_image->load_addr); @@ -116,7 +116,7 @@ int spl_load_legacy_img(struct spl_image_info *spl_image, lzma_len = LZMA_LEN; /* dataptr points to compressed payload */ - dataptr = offset + sizeof(hdr); + dataptr = offset + sizeof(*hdr); debug("LZMA: Decompressing %08lx to %08lx\n", dataptr, spl_image->load_addr); |
