]> git.sur5r.net Git - u-boot/blobdiff - lib/efi_loader/efi_boottime.c
efi_loader: create handles from normal memory
[u-boot] / lib / efi_loader / efi_boottime.c
index b7ab2e8208e6783bd511a94c80c073bb21732f34..50d311548e2d4cc09d56102bd95884a29206b6d6 100644 (file)
@@ -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;
 }
 
 /**