efi_selftest: events unit test, check return values
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 6 Jan 2019 15:38:57 +0000 (16:38 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 13 Feb 2019 08:40:05 +0000 (09:40 +0100)
For some API calls checks for the return values are missing.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_selftest/efi_selftest_events.c

index ed99a538045a6e90d26b2b388726c514b6058231..1077cbdf9e6aa88a4468065cd03cac249dfd086a 100644 (file)
@@ -147,20 +147,20 @@ static int execute(void)
                return EFI_ST_FAILURE;
        }
        ret = boottime->set_timer(event_notify, EFI_TIMER_STOP, 0);
-       if (index != 0) {
+       if (ret != EFI_SUCCESS) {
                efi_st_error("Could not cancel timer\n");
                return EFI_ST_FAILURE;
        }
        /* Set 10 ms timer */
        timer_ticks = 0;
        ret = boottime->set_timer(event_notify, EFI_TIMER_RELATIVE, 100000);
-       if (index != 0) {
+       if (ret != EFI_SUCCESS) {
                efi_st_error("Could not set timer\n");
                return EFI_ST_FAILURE;
        }
        /* Set 100 ms timer */
        ret = boottime->set_timer(event_wait, EFI_TIMER_PERIODIC, 1000000);
-       if (index != 0) {
+       if (ret != EFI_SUCCESS) {
                efi_st_error("Could not set timer\n");
                return EFI_ST_FAILURE;
        }