diff options
author | Tom Rini <trini@konsulko.com> | 2019-05-19 16:46:24 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-05-19 16:46:24 -0400 |
commit | ab487c8568fe35e97943d121e9b9192884cc0d1d (patch) | |
tree | 2615e6d8b29b7dae50854381509a049e6d2c2ced /lib/efi_loader/efi_variable.c | |
parent | e14d9ca4919e5bc987fc628135104f2b2c91af90 (diff) | |
parent | b31ca6bf8484ca10bab4ae544698294a4197bef9 (diff) |
Merge tag 'efi-2019-07-rc3-2' of git://git.denx.de/u-boot-efi
Pull request for UEFI sub-system for v2019.07-rc3 (2)
Minor patches to improve UEFI specification compliance are provided.
To allow running the UEFI self compliance tests an outdated version of
the Unicode collation protocol has been added as a configuration option
(disabled by default).
Diffstat (limited to 'lib/efi_loader/efi_variable.c')
-rw-r--r-- | lib/efi_loader/efi_variable.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index 37728c3c165..28b1aa7505a 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -202,8 +202,10 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name, len /= 2; *data_size = len; - if (in_size < len) - return EFI_EXIT(EFI_BUFFER_TOO_SMALL); + if (in_size < len) { + ret = EFI_BUFFER_TOO_SMALL; + goto out; + } if (!data) return EFI_EXIT(EFI_INVALID_PARAMETER); @@ -217,8 +219,10 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name, *data_size = len; - if (in_size < len) - return EFI_EXIT(EFI_BUFFER_TOO_SMALL); + if (in_size < len) { + ret = EFI_BUFFER_TOO_SMALL; + goto out; + } if (!data) return EFI_EXIT(EFI_INVALID_PARAMETER); @@ -232,10 +236,11 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name, return EFI_EXIT(EFI_DEVICE_ERROR); } +out: if (attributes) *attributes = attr & EFI_VARIABLE_MASK; - return EFI_EXIT(EFI_SUCCESS); + return EFI_EXIT(ret); } static char *efi_variables_list; |