diff options
author | Daniel Kiper <daniel.kiper@oracle.com> | 2014-06-30 17:52:57 (GMT) |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-07-18 20:23:54 (GMT) |
commit | 67a9b9c53cafd3f391dccc84a3af45334c6267fc (patch) | |
tree | 6b3d88f0a51007c51b0958b44fda262bcafb454a /arch/x86/platform/efi | |
parent | abc93f8eb6e46a480485f19256bdbda36ec78a84 (diff) | |
download | linux-67a9b9c53cafd3f391dccc84a3af45334c6267fc.tar.xz |
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 <daniel.kiper@oracle.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/platform/efi')
-rw-r--r-- | arch/x86/platform/efi/efi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index b405972..7d627a0 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) && |