Skip to content

Commit 88447c5

Browse files
rbradfordIngo Molnar
authored andcommitted
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]>
1 parent 4e78921 commit 88447c5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

arch/x86/platform/efi/quirks.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,9 @@ int __init efi_reuse_config(u64 tables, int nr_tables)
513513
void *p, *tablep;
514514
struct efi_setup_data *data;
515515

516+
if (nr_tables == 0)
517+
return 0;
518+
516519
if (!efi_setup)
517520
return 0;
518521

drivers/firmware/efi/efi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ int __init efi_config_init(efi_config_table_type_t *arch_tables)
636636
void *config_tables;
637637
int sz, ret;
638638

639+
if (efi.systab->nr_tables == 0)
640+
return 0;
641+
639642
if (efi_enabled(EFI_64BIT))
640643
sz = sizeof(efi_config_table_64_t);
641644
else

0 commit comments

Comments
 (0)