mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-09-20 22:52:00 +00:00
efi_loader: LoadImage w/o SourceBuffer and DevicePath
If both SourceBuffer and DevicePath are NULL, LoadImage() must return EFI_INVALID_PARAMETER. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
698bc1f2e9
commit
e4afcb2876
1 changed files with 4 additions and 11 deletions
|
@ -1856,17 +1856,10 @@ efi_status_t EFIAPI efi_load_image(bool boot_policy,
|
||||||
EFI_ENTRY("%d, %p, %pD, %p, %zd, %p", boot_policy, parent_image,
|
EFI_ENTRY("%d, %p, %pD, %p, %zd, %p", boot_policy, parent_image,
|
||||||
file_path, source_buffer, source_size, image_handle);
|
file_path, source_buffer, source_size, image_handle);
|
||||||
|
|
||||||
if (!image_handle || !efi_search_obj(parent_image)) {
|
if (!image_handle || (!source_buffer && !file_path) ||
|
||||||
ret = EFI_INVALID_PARAMETER;
|
!efi_search_obj(parent_image) ||
|
||||||
goto error;
|
/* The parent image handle must refer to a loaded image */
|
||||||
}
|
!parent_image->type) {
|
||||||
|
|
||||||
if (!source_buffer && !file_path) {
|
|
||||||
ret = EFI_NOT_FOUND;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
/* The parent image handle must refer to a loaded image */
|
|
||||||
if (!parent_image->type) {
|
|
||||||
ret = EFI_INVALID_PARAMETER;
|
ret = EFI_INVALID_PARAMETER;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue