summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/efi_loader/efi_capsule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 9ead0d2c78..60309d4a07 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -901,7 +901,8 @@ static efi_status_t efi_capsule_delete_file(const u16 *filename)
/* ignore an error */
EFI_CALL((*dirh->close)(dirh));
- ret = EFI_CALL((*fh->delete)(fh));
+ if (ret == EFI_SUCCESS)
+ ret = EFI_CALL((*fh->delete)(fh));
return ret;
}