From cbd5cd7d6db41bdda7c7122259dbab79de64bb40 Mon Sep 17 00:00:00 2001
From: Robert Elliott <elliott@hpe.com>
Date: Thu, 3 Dec 2015 11:43:09 -0600
Subject: [PATCH v2 2/3] efiemu: Handle all reserved UEFI memory map types the
 same way

In grub_efiemu_mmap_iterate, handle all undefined UEFI memory map
types the same - don't handle MAX_MEMORY_TYPE (which is not really
a type) differently and ignore the rest of the undefined types.

UEFI 2.5 defined type 14, which was formerly reserved and the value
of MAX_MEMORY_TYPE, as Persistent Memory.  MAX_MEMORY_TYPE becomes
type 15, and handling one potentially changing reserved value
differently than others is dangerous.
---
 grub-core/efiemu/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c
index d4a4f3a..4808bcc 100644
--- a/grub-core/efiemu/mm.c
+++ b/grub-core/efiemu/mm.c
@@ -445,7 +445,7 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
       case GRUB_EFI_MEMORY_MAPPED_IO:
       case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE:
       case GRUB_EFI_PAL_CODE:
-      case GRUB_EFI_MAX_MEMORY_TYPE:
+      default:
 	hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096,
 	      GRUB_MEMORY_RESERVED, hook_data);
 	break;
-- 
2.4.3

