summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-05-27 16:47:21 +0200
committerAlexander Graf <agraf@suse.de>2018-06-03 15:27:21 +0200
commitd29e7824d782272f29dee68ea0ebb588257aacb4 (patch)
tree352f6541453493333ea1f4a3e0b3da20a28342d9 /lib/efi_loader
parent3282614081ff3dcacd79a870475b332cbee3ff28 (diff)
efi_loader: create handles from normal memory
Handles are not used at runtime. They are freed by the firmware when the last protocol interface is uninstalled. So there is no reason to use EFI memory when creating handles. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_boottime.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index b7ab2e8208..50d311548e 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -431,16 +431,15 @@ void efi_add_handle(struct efi_object *obj)
efi_status_t efi_create_handle(efi_handle_t *handle)
{
struct efi_object *obj;
- efi_status_t r;
- r = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES,
- sizeof(struct efi_object),
- (void **)&obj);
- if (r != EFI_SUCCESS)
- return r;
+ obj = calloc(1, sizeof(struct efi_object));
+ if (!obj)
+ return EFI_OUT_OF_RESOURCES;
+
efi_add_handle(obj);
*handle = obj->handle;
- return r;
+
+ return EFI_SUCCESS;
}
/**