[PATCH 2/4] efi_runtime: add datasize return when getting the EFI_BUFFER_TOO_SMALL
Ivan Hu
ivan.hu at canonical.com
Mon Aug 8 09:40:26 UTC 2016
Data size is required to return when getting the EFI_BUFFER_TOO_SMALL
for user to obtain and set the required data buffer size.
Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
efi_runtime/efi_runtime.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c
index c73d968..8c77c77 100644
--- a/efi_runtime/efi_runtime.c
+++ b/efi_runtime/efi_runtime.c
@@ -235,6 +235,10 @@ static long efi_runtime_get_variable(unsigned long arg)
if (dz && put_user(datasize, getvariable_local.data_size))
return -EFAULT;
return 0;
+ } else if (status == EFI_BUFFER_TOO_SMALL) {
+ if (dz && put_user(datasize, getvariable_local.data_size))
+ return -EFAULT;
+ return -EINVAL;
} else {
return -EINVAL;
}
--
1.9.1
More information about the fwts-devel
mailing list