From patchwork Sat May 30 20:44:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 246878 List-Id: U-Boot discussion From: marex at denx.de (Marek Vasut) Date: Sat, 30 May 2020 22:44:45 +0200 Subject: [PATCH 1/2] ARM: imx: m53menlo: Do not fail boot on invalid splash screen Message-ID: <20200530204446.273323-1-marex@denx.de> None of these splash screen loading errors are so critical as to justify complete failure to boot, so just print error message as needed and return 0, the boot can very likely continue without the splash. Fix a couple of missing free(dst) instances as well. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: NXP i.MX U-Boot Team Cc: Peng Fan Cc: Stefano Babic --- board/menlo/m53menlo/m53menlo.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c index 58a564ac31..d4288a2c57 100644 --- a/board/menlo/m53menlo/m53menlo.c +++ b/board/menlo/m53menlo/m53menlo.c @@ -353,24 +353,28 @@ int board_late_init(void) ret = splash_screen_prepare(); if (ret < 0) - return ret; + goto splasherr; len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE; ret = gunzip(dst + 2, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE - 2, (uchar *)addr, &len); if (ret) { printf("Error: no valid bmp or bmp.gz image at %lx\n", addr); - free(dst); - return ret; + goto splasherr; } ret = uclass_get_device(UCLASS_VIDEO, 0, &dev); if (ret) - return ret; + goto splasherr; ret = video_bmp_display(dev, (ulong)dst + 2, xpos, ypos, true); if (ret) - return ret; + goto splasherr; + + return 0; + +splasherr: + free(dst); #endif return 0; }