aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_selftest/efi_selftest_block_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/efi_selftest/efi_selftest_block_device.c')
-rw-r--r--lib/efi_selftest/efi_selftest_block_device.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/efi_selftest/efi_selftest_block_device.c b/lib/efi_selftest/efi_selftest_block_device.c
index d4e4fac1c74..f038da9f190 100644
--- a/lib/efi_selftest/efi_selftest_block_device.c
+++ b/lib/efi_selftest/efi_selftest_block_device.c
@@ -445,11 +445,6 @@ static int execute(void)
efi_st_error("Failed to write file\n");
return EFI_ST_FAILURE;
}
- ret = file->close(file);
- if (ret != EFI_SUCCESS) {
- efi_st_error("Failed to close file\n");
- return EFI_ST_FAILURE;
- }
ret = file->getpos(file, &pos);
if (ret != EFI_SUCCESS) {
efi_st_error("GetPosition failed\n");
@@ -460,6 +455,11 @@ static int execute(void)
(unsigned int)pos);
return EFI_ST_FAILURE;
}
+ ret = file->close(file);
+ if (ret != EFI_SUCCESS) {
+ efi_st_error("Failed to close file\n");
+ return EFI_ST_FAILURE;
+ }
/* Verify file */
boottime->set_mem(buf, sizeof(buf), 0);