]> git.dujemihanovic.xyz Git - u-boot.git/commit
spl: nor: Don't allocate header on stack
authorSean Anderson <seanga2@gmail.com>
Sat, 14 Oct 2023 20:47:38 +0000 (16:47 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 18 Oct 2023 00:50:52 +0000 (20:50 -0400)
commit6cc2182c84a94d7d765b392e4801cc3e11f404ca
tree1d4e349c0b51fd9bc895ce7f5e8f1439bd27d1cc
parent301ae618424f48daba766cb0164a752623f8dbec
spl: nor: Don't allocate header on stack

spl_image_info.name contains a reference to legacy_img_hdr. If we allocate
the latter on the stack, it will be clobbered after we return. This was
addressed for NAND back in 06377c5a1fc ("spl: spl_legacy: Fix NAND boot on
OMAP3 BeagleBoard"), but that commit didn't fix NOR.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
common/spl/spl_nor.c