common: bootm: Add missing check of fit_open_image() return code
PATCH 1/1 common: bootm: Add missing check of fit_open_image() return code
Check the return code of fit_open_image() inside bootm_load_initrd(). Without this check, the code works with undefined values of "initrd_size" and "initrd" should fit_open_image() fail.
Signed-off-by Albert Schwarzkopf <[email protected]>
--- common/bootm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
common/bootm.c +5 -1
@@ -232,7 +232,11 @@ int bootm_load_initrd(struct image_data *data, unsigned long load_address) ret =fit_open_image (data->os_fit, data->fit_config,"ramdisk" , &initrd, &initrd_size); - +if (ret) { +pr_err ("Cannot open ramdisk image in FIT image: %s\n" , +strerror (-ret)); +return ret; + } data->initrd_res =request_sdram_region ("initrd" , load_address, initrd_size);
Signature · 7 lines
2.25.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 8 lines · Albert Schwarzkopf
Check the return code of
fit_open_image()insidebootm_load_initrd(). Without this check, the code works with undefined values of "initrd_size" and "initrd" shouldfit_open_image()fail.Signed-off-by Albert Schwarzkopf <[email protected]>--- common/bootm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox