display5: spl: Check return code of the env_* functions
Force booting through u-boot proper when environment error encountered
(as a result of either broken SPI-NOR or erased envs).
Signed-off-by: Lukasz Majewski <lukma@denx.de>
diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c
index 6508e0f..0d25b0d9 100644
--- a/board/liebherr/display5/spl.c
+++ b/board/liebherr/display5/spl.c
@@ -210,8 +210,8 @@
/* 'fastboot' */
const char *s;
- env_init();
- env_load();
+ if (env_init() || env_load())
+ return;
s = env_get("BOOT_FROM");
if (s && !bootcount_error() && strcmp(s, "ACTIVE") == 0) {