mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-21 14:11:36 +00:00
efi_loader: check CreateEvent() parameters
Add some of the invalid parameter checks described in the UEFI specification for CreateEvent(). This does not include checking the validity of the type and tpl parameters. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Acked-By: Heinrich Schuchardt <xypron.glpk@gmx.de> [agraf: fix checkpatch.pl indent warning] Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
37a980b3fa
commit
a95343b8d3
1 changed files with 10 additions and 0 deletions
|
@ -189,6 +189,16 @@ static efi_status_t EFIAPI efi_create_event(
|
||||||
return EFI_EXIT(EFI_OUT_OF_RESOURCES);
|
return EFI_EXIT(EFI_OUT_OF_RESOURCES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event == NULL)
|
||||||
|
return EFI_EXIT(EFI_INVALID_PARAMETER);
|
||||||
|
|
||||||
|
if ((type & EVT_NOTIFY_SIGNAL) && (type & EVT_NOTIFY_WAIT))
|
||||||
|
return EFI_EXIT(EFI_INVALID_PARAMETER);
|
||||||
|
|
||||||
|
if ((type & (EVT_NOTIFY_SIGNAL|EVT_NOTIFY_WAIT)) &&
|
||||||
|
notify_function == NULL)
|
||||||
|
return EFI_EXIT(EFI_INVALID_PARAMETER);
|
||||||
|
|
||||||
efi_event.type = type;
|
efi_event.type = type;
|
||||||
efi_event.notify_tpl = notify_tpl;
|
efi_event.notify_tpl = notify_tpl;
|
||||||
efi_event.notify_function = notify_function;
|
efi_event.notify_function = notify_function;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue