common: spl: spl_fit.c: report an error on hash check fail
PATCH 1/1 common: spl: spl_fit.c: report an error on hash check fail
When the hash check fails on a loadable image, the SPL/TPL simply jump to the next one. This commit changes this behaviour, when the hash check fails on a loadable image, the function spl_load_simple_fit stops and report an error.
--- common/spl/spl_fit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
common/spl/spl_fit.c +5 -2
@@ -667,8 +667,11 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, ret =spl_load_fit_image (info, sector, fit, base_offset, node, &image_info); -if (ret <0 ) -continue ; +if (ret <0 ) { +printf ("%s: can't load image loadables index %d (ret = %d)\n" , + __func__, index, ret); +return ret; + }if (!spl_fit_image_get_os (fit, node, &os_type))debug ("Loadable is %s\n" ,genimg_get_os_name (os_type));
Signature · 1 line
2.17.1
PATCH 1/1 common: spl: spl_fit.c: report an error on hash check fail
Quoted 10 lines · Philippe Reynes
When the hash check fails on a loadable image, the SPL/TPL simply jump to the next one. This commit changes this behaviour, when the hash check fails on a loadable image, the function
spl_load_simple_fitstops and report an error.Signed-off-by Philippe Reynes <[email protected]>--- common/spl/spl_fit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
This should have a test. We have sandbox SPL test support now so it should not be too hard.
PATCH 1/1 common: spl: spl_fit.c: report an error on hash check fail
In reply to Philippe ReynesQuoted 7 lines · Philippe Reynes
When the hash check fails on a loadable image, the SPL/TPL simply jump to the next one. This commit changes this behaviour, when the hash check fails on a loadable image, the function
spl_load_simple_fitstops and report an error.Signed-off-by Philippe Reynes <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
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/20210118/212b3d02/attachment.sig>