mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
efi_loader: QueryMode() check parameters
Check the parameters of EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
3352b306bf
commit
997c2ce5cf
1 changed files with 8 additions and 1 deletions
|
@ -41,14 +41,21 @@ static efi_status_t EFIAPI gop_query_mode(struct efi_gop *this, u32 mode_number,
|
||||||
struct efi_gop_mode_info **info)
|
struct efi_gop_mode_info **info)
|
||||||
{
|
{
|
||||||
struct efi_gop_obj *gopobj;
|
struct efi_gop_obj *gopobj;
|
||||||
|
efi_status_t ret = EFI_SUCCESS;
|
||||||
|
|
||||||
EFI_ENTRY("%p, %x, %p, %p", this, mode_number, size_of_info, info);
|
EFI_ENTRY("%p, %x, %p, %p", this, mode_number, size_of_info, info);
|
||||||
|
|
||||||
|
if (!this || !size_of_info || !info || mode_number) {
|
||||||
|
ret = EFI_INVALID_PARAMETER;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
gopobj = container_of(this, struct efi_gop_obj, ops);
|
gopobj = container_of(this, struct efi_gop_obj, ops);
|
||||||
*size_of_info = sizeof(gopobj->info);
|
*size_of_info = sizeof(gopobj->info);
|
||||||
*info = &gopobj->info;
|
*info = &gopobj->info;
|
||||||
|
|
||||||
return EFI_EXIT(EFI_SUCCESS);
|
out:
|
||||||
|
return EFI_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static efi_status_t EFIAPI gop_set_mode(struct efi_gop *this, u32 mode_number)
|
static efi_status_t EFIAPI gop_set_mode(struct efi_gop *this, u32 mode_number)
|
||||||
|
|
Loading…
Reference in a new issue