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 <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>

authored by Rob Bradford and committed by Ingo Molnar 88447c5b 4e78921b

Changed files
+6
arch
x86
platform
efi
drivers
firmware
efi
+3
arch/x86/platform/efi/quirks.c
··· 513 513 void *p, *tablep; 514 514 struct efi_setup_data *data; 515 515 516 + if (nr_tables == 0) 517 + return 0; 518 + 516 519 if (!efi_setup) 517 520 return 0; 518 521
+3
drivers/firmware/efi/efi.c
··· 636 636 void *config_tables; 637 637 int sz, ret; 638 638 639 + if (efi.systab->nr_tables == 0) 640 + return 0; 641 + 639 642 if (efi_enabled(EFI_64BIT)) 640 643 sz = sizeof(efi_config_table_64_t); 641 644 else