[PATCH] spl: spl_legacy: fix invalid offset in SPL_COPY_PAYLOAD_ONLY

Tom Rini trini at konsulko.com
Fri Dec 9 23:32:45 CET 2022


On Fri, Dec 09, 2022 at 01:58:26PM +0100, Michael Nazzareno Trimarchi wrote:
> Hi
> 
> On Fri, Dec 9, 2022 at 1:55 PM Michael Nazzareno Trimarchi
> <michael at amarulasolutions.com> wrote:
> >
> > Hi
> >
> > On Fri, Dec 9, 2022 at 1:52 PM Dai Okamura <okamura.dai at socionext.com> wrote:
> > >
> > > 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 at 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);
> > > --
> >
> > Reviewed-By: Michael Trimarchi <michael at amarulasolutions.com>
> >
> 
> Tom can I pick it on nand-next or is going from your tree

Your next branch for my next branch sounds good to me, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20221209/389f4de6/attachment.sig>


More information about the U-Boot mailing list