]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
efi: Allow the number of EFI configuration tables entries to be zero
authorRob Bradford <robert.bradford@intel.com>
Sat, 25 May 2019 11:25:59 +0000 (13:25 +0200)
committerIngo Molnar <mingo@kernel.org>
Sat, 25 May 2019 11:48:17 +0000 (13:48 +0200)
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 <robert.bradford@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gen Zhang <blackgod016574@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20190525112559.7917-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/platform/efi/quirks.c
drivers/firmware/efi/efi.c

index feb77777c8b817bc2a157230d417d559a2881083..632b8388586750f6a6cfcfead12053305f0fa505 100644 (file)
@@ -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;
 
index 55b77c576c428e96c8d10615087470916ede502a..521a541d02ad0bb5f818430adf09d85a53248c64 100644 (file)
@@ -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