diff options
author | Rob Bradford <[email protected]> | 2019-05-25 13:25:59 +0200 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2019-05-25 13:48:17 +0200 |
commit | 88447c5b93d98be847f428c39ba589779a59eb83 (patch) | |
tree | cee45ba436e2cd3dda721a76d23a2e8c8ef4ecf7 | |
parent | 4e78921ba4dd0aca1cc89168f45039add4183f8e (diff) |
efi: Allow the number of EFI configuration tables entries to be zero
Only try and access the EFI configuration tables if there there are any
reported. This allows EFI to be continued to used on systems where there
are no configuration table entries.
Signed-off-by: Rob Bradford <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Cc: Gen Zhang <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r-- | arch/x86/platform/efi/quirks.c | 3 | ||||
-rw-r--r-- | drivers/firmware/efi/efi.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index feb77777c8b8..632b83885867 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -513,6 +513,9 @@ int __init efi_reuse_config(u64 tables, int nr_tables) void *p, *tablep; struct efi_setup_data *data; + if (nr_tables == 0) + return 0; + if (!efi_setup) return 0; diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 55b77c576c42..521a541d02ad 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -636,6 +636,9 @@ int __init efi_config_init(efi_config_table_type_t *arch_tables) void *config_tables; int sz, ret; + if (efi.systab->nr_tables == 0) + return 0; + if (efi_enabled(EFI_64BIT)) sz = sizeof(efi_config_table_64_t); else |