diff options
author | Jan Janssen <medhefgo@web.de> | 2018-01-07 11:53:34 +0100 |
---|---|---|
committer | Jan Janssen <medhefgo@web.de> | 2018-01-28 17:20:41 +0100 |
commit | 33d4ba32c93cba64832ce73c50cfd316200c0be3 (patch) | |
tree | 68c3b6fafdd531d6a1add0a53241bc504a3b5e07 /src/boot/efi/shim.c | |
parent | 46659f7deb962f55c728e70597e37c2a3ab6326d (diff) | |
download | systemd-33d4ba32c93cba64832ce73c50cfd316200c0be3.tar.gz |
systemd-boot: Return EFI_STATUS instead of INTN for file_read()
file_read() wants to return both a EFI_STATUS (INTN) and a file
length (UINTN). This seems rather fishy for either large files or
when returning errors (which are defined as positive numbers).
Let's just be more clear and return EFI_STATUS and let the file
length be a pointer.
Diffstat (limited to 'src/boot/efi/shim.c')
-rw-r--r-- | src/boot/efi/shim.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/boot/efi/shim.c b/src/boot/efi/shim.c index 6d7d814c5c..7c479048c1 100644 --- a/src/boot/efi/shim.c +++ b/src/boot/efi/shim.c @@ -179,7 +179,10 @@ static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROT dev_path_str = DevicePathToStr(dev_path); FreePool(dev_path); - file_size = file_read(root, dev_path_str, 0, 0, &file_buffer); + status = file_read(root, dev_path_str, 0, 0, &file_buffer, &file_size); + if (EFI_ERROR(status)) + return status; + FreePool(dev_path_str); uefi_call_wrapper(root->Close, 1, root); |