summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_variable.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-05-19 16:46:24 -0400
committerTom Rini <trini@konsulko.com>2019-05-19 16:46:24 -0400
commitab487c8568fe35e97943d121e9b9192884cc0d1d (patch)
tree2615e6d8b29b7dae50854381509a049e6d2c2ced /lib/efi_loader/efi_variable.c
parente14d9ca4919e5bc987fc628135104f2b2c91af90 (diff)
parentb31ca6bf8484ca10bab4ae544698294a4197bef9 (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.c15
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;