diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-06-15 15:07:40 +0300 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-06-21 01:26:15 +0300 |
commit | 97cf20861ac2a359bcde930d4ab17cec70da81f7 (patch) | |
tree | 37ec4765c805b3cda76c3fa383545efeaa146a31 /lib/efi_loader/efi_gop.c | |
parent | 1f7a8b3389d66f279bf75fcfdd10c1c7d2561d6e (diff) | |
download | u-boot-97cf20861ac2a359bcde930d4ab17cec70da81f7.tar.xz |
efi_loader: QueryMode() must allocate buffer
EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode() must allocate a buffer for the
mode information structure.
Adjust the unit test to free the buffer.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_gop.c')
-rw-r--r-- | lib/efi_loader/efi_gop.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c index 676463f2de..2385c0f3b1 100644 --- a/lib/efi_loader/efi_gop.c +++ b/lib/efi_loader/efi_gop.c @@ -51,8 +51,12 @@ static efi_status_t EFIAPI gop_query_mode(struct efi_gop *this, u32 mode_number, } gopobj = container_of(this, struct efi_gop_obj, ops); + ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, sizeof(gopobj->info), + (void **)info); + if (ret != EFI_SUCCESS) + goto out; *size_of_info = sizeof(gopobj->info); - *info = &gopobj->info; + memcpy(*info, &gopobj->info, sizeof(gopobj->info)); out: return EFI_EXIT(ret); |