From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Thu, 12 Oct 2017 23:00:05 +0000 (+0200)
Subject: efi_selftest: correctly check return values
X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=abe994633b2ad56c5eea87c9253873f41dab477d;p=project%2Fbcm63xx%2Fu-boot.git

efi_selftest: correctly check return values

When cancelling the timer we should check the return
value provided by the set_timer service.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
---

diff --git a/lib/efi_selftest/efi_selftest_events.c b/lib/efi_selftest/efi_selftest_events.c
index b2cdc150da..081f31257f 100644
--- a/lib/efi_selftest/efi_selftest_events.c
+++ b/lib/efi_selftest/efi_selftest_events.c
@@ -186,7 +186,7 @@ static int execute(void)
 		return EFI_ST_FAILURE;
 	}
 	ret = boottime->set_timer(event_wait, EFI_TIMER_STOP, 0);
-	if (index != 0) {
+	if (ret != EFI_SUCCESS) {
 		efi_st_error("Could not cancel timer\n");
 		return EFI_ST_FAILURE;
 	}
diff --git a/lib/efi_selftest/efi_selftest_tpl.c b/lib/efi_selftest/efi_selftest_tpl.c
index b8c0e70262..ddb67ed268 100644
--- a/lib/efi_selftest/efi_selftest_tpl.c
+++ b/lib/efi_selftest/efi_selftest_tpl.c
@@ -207,7 +207,7 @@ static int execute(void)
 		return EFI_ST_FAILURE;
 	}
 	ret = boottime->set_timer(event_wait, EFI_TIMER_STOP, 0);
-	if (index != 0) {
+	if (ret != EFI_SUCCESS) {
 		efi_st_error("Could not cancel timer\n");
 		return EFI_ST_FAILURE;
 	}