From: Daniel Kiper Date: Mon, 30 Jun 2014 17:52:57 +0000 (+0200) Subject: arch/x86: Do not access EFI memory map if it is not available X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=67a9b9c53cafd3f391dccc84a3af45334c6267fc;p=deliverable%2Flinux.git arch/x86: Do not access EFI memory map if it is not available Do not access EFI memory map if it is not available. At least Xen dom0 EFI implementation does not have an access to it. Signed-off-by: Daniel Kiper Signed-off-by: Matt Fleming --- diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index b40597209623..7d627a02ed82 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -946,6 +946,9 @@ u64 efi_mem_attributes(unsigned long phys_addr) efi_memory_desc_t *md; void *p; + if (!efi_enabled(EFI_MEMMAP)) + return 0; + for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { md = p; if ((md->phys_addr <= phys_addr) &&