Pārlūkot izejas kodu

[efi] Report failures to stop the EFI timer tick event

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 gadus atpakaļ
vecāks
revīzija
694c18addc
1 mainītis faili ar 16 papildinājumiem un 2 dzēšanām
  1. 16
    2
      src/interface/efi/efi_timer.c

+ 16
- 2
src/interface/efi/efi_timer.c Parādīt failu

@@ -126,13 +126,27 @@ static void efi_tick_startup ( void ) {
126 126
  */
127 127
 static void efi_tick_shutdown ( int booting __unused ) {
128 128
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
129
+	EFI_STATUS efirc;
130
+	int rc;
129 131
 
130 132
 	/* Stop timer tick */
131
-	bs->SetTimer ( efi_tick_event, TimerCancel, 0 );
133
+	if ( ( efirc = bs->SetTimer ( efi_tick_event, TimerCancel, 0 ) ) != 0 ){
134
+		rc = -EEFI ( efirc );
135
+		DBGC ( colour, "EFI could not stop timer tick: %s\n",
136
+		       strerror ( rc ) );
137
+		/* Self-destruct initiated */
138
+		return;
139
+	}
132 140
 	DBGC ( colour, "EFI timer stopped\n" );
133 141
 
134 142
 	/* Destroy timer tick event */
135
-	bs->CloseEvent ( efi_tick_event );
143
+	if ( ( efirc = bs->CloseEvent ( efi_tick_event ) ) != 0 ) {
144
+		rc = -EEFI ( efirc );
145
+		DBGC ( colour, "EFI could not destroy timer tick: %s\n",
146
+		       strerror ( rc ) );
147
+		/* Probably non-fatal */
148
+		return;
149
+	}
136 150
 }
137 151
 
138 152
 /** Timer tick startup function */

Notiek ielāde…
Atcelt
Saglabāt