From: Ard Biesheuvel <ard.biesheu...@linaro.org> commit c05f8f92b701576b615f30aac31fabdc0648649b upstream.
The kernel command line option efivar_ssdt= allows the name to be specified of an EFI variable containing an ACPI SSDT table that should be loaded into memory by the OS, and treated as if it was provided by the firmware. Currently, that code will always iterate over the EFI variables and compare each name with the provided name, even if the command line option wasn't set to begin with. So bail early when no variable name was provided. This works around a boot regression on the 2012 Mac Pro, as reported by Scott. Tested-by: Scott Talbert <s...@techie.net> Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> Cc: <sta...@vger.kernel.org> # v4.9+ Cc: Ben Dooks <ben.do...@codethink.co.uk> Cc: Dave Young <dyo...@redhat.com> Cc: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> Cc: Jerry Snitselaar <jsnit...@redhat.com> Cc: Linus Torvalds <torva...@linux-foundation.org> Cc: Lukas Wunner <lu...@wunner.de> Cc: Lyude Paul <ly...@redhat.com> Cc: Matthew Garrett <mj...@google.com> Cc: Octavian Purdila <octavian.purd...@intel.com> Cc: Peter Jones <pjo...@redhat.com> Cc: Peter Zijlstra <pet...@infradead.org> Cc: Thomas Gleixner <t...@linutronix.de> Cc: linux-...@vger.kernel.org Cc: linux-integr...@vger.kernel.org Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables") Link: https://lkml.kernel.org/r/20191002165904.8819-3-ard.biesheu...@linaro.org Signed-off-by: Ingo Molnar <mi...@kernel.org> Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> --- drivers/firmware/efi/efi.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -281,6 +281,9 @@ static __init int efivar_ssdt_load(void) void *data; int ret; + if (!efivar_ssdt[0]) + return 0; + ret = efivar_init(efivar_ssdt_iter, &entries, true, &entries); list_for_each_entry_safe(entry, aux, &entries, list) {