efi_loader: out of resources in AllocatePages()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 11 May 2019 05:55:05 +0000 (07:55 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 12 May 2019 18:54:22 +0000 (20:54 +0200)
According to the UEFI AllocatePages() has to return EFI_OUT_OF_RESOURCES if
sufficient memory is not available.

Change the return value.

UEFI SCT II (2017): 3.2.1 AllocatePages(), 5.1.2.1.8

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_memory.c

index b75722dac3366eaf74455f52229688580e7c7eea..adbeb1db6b75d17aaf3b8b8a67310cb550de017a 100644 (file)
@@ -424,7 +424,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type,
                /* Any page */
                addr = efi_find_free_memory(len, -1ULL);
                if (!addr) {
-                       r = EFI_NOT_FOUND;
+                       r = EFI_OUT_OF_RESOURCES;
                        break;
                }
                break;
@@ -432,7 +432,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type,
                /* Max address */
                addr = efi_find_free_memory(len, *memory);
                if (!addr) {
-                       r = EFI_NOT_FOUND;
+                       r = EFI_OUT_OF_RESOURCES;
                        break;
                }
                break;