From 0d254b0e4d19cdac49348e34bfda3a358eee47f5 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 10 Sep 2012 17:35:13 +0200 Subject: kontron_wdt: Adjusting exit path If we fail, at least let's boot the expected image --- com32/modules/kontron_wdt.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/com32/modules/kontron_wdt.c b/com32/modules/kontron_wdt.c index 46d37d0f..6d21d7c2 100644 --- a/com32/modules/kontron_wdt.c +++ b/com32/modules/kontron_wdt.c @@ -380,28 +380,31 @@ int main(int argc, const char *argv[]) { if (status & KEMPLD_WDT_CFG_ENABLE) { kempld_wdt_keepalive(&wdt); } else { - ret = kempld_wdt_settimeout(&wdt); + ret = kempld_wdt_settimeout(&wdt); if (ret) { printf("Unable to setup timeout !\n"); - kempld_release_mutex(&pld); - return -1; + goto booting; } - ret = kempld_wdt_start(&wdt); + + ret = kempld_wdt_start(&wdt); if (ret) { printf("Unable to start watchdog !\n"); - kempld_release_mutex(&pld); - return -1; + goto booting; } } + printf("Watchog armed ! Rebooting in %d seconds if no feed occurs !\n",wdt.timeout); + +booting: /* Release Mutex to let Linux's Driver taking control */ kempld_release_mutex(&pld); - printf("Watchog armed ! Rebooting in %d seconds if no feed occurs !\n",wdt.timeout); /* Let's boot the default entry if specified */ if (strlen(default_label)>0) { printf("Executing default label = '%s'\n",default_label); syslinux_run_command(default_label); + } else { + return ret; } } -- cgit v1.2.1