All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dai Okamura <okamura.dai@socionext.com>
To: u-boot@lists.denx.de
Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	Dai Okamura <okamura.dai@socionext.com>
Subject: [PATCH] spl: spl_legacy: fix invalid offset in SPL_COPY_PAYLOAD_ONLY
Date: Fri,  9 Dec 2022 20:40:21 +0900	[thread overview]
Message-ID: <20221209114021.3074978-1-okamura.dai@socionext.com> (raw)

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 <okamura.dai@socionext.com>
---
 common/spl/spl_legacy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
index 4c7f44687e..16851c55eb 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);
-- 
2.35.1


             reply	other threads:[~2022-12-09 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 11:40 Dai Okamura [this message]
2022-12-09 12:55 ` [PATCH] spl: spl_legacy: fix invalid offset in SPL_COPY_PAYLOAD_ONLY Michael Nazzareno Trimarchi
2022-12-09 12:58   ` Michael Nazzareno Trimarchi
2022-12-09 22:32     ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221209114021.3074978-1-okamura.dai@socionext.com \
    --to=okamura.dai@socionext.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.