unhook_system_services: bail on systab == NULL

Prevent unhook_system_services() from dereferencing a NULL systab, which
may occur if hook_system_services() has never been called.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Ard Biesheuvel 2014-08-12 15:33:19 +02:00 committed by Peter Jones
parent a30276e095
commit 77cdb40423

View File

@ -70,6 +70,9 @@ static EFI_HANDLE last_loaded_image;
void
unhook_system_services(void)
{
if (!systab)
return;
systab->BootServices->Exit = system_exit;
systab->BootServices->LoadImage = system_load_image;
systab->BootServices->StartImage = system_start_image;