From: Heinrich Schuchardt Date: Mon, 17 Jun 2019 20:00:13 +0000 (+0200) Subject: efi_loader: Delete() return EFI_WARN_DELETE_FAILURE X-Git-Tag: v2019.07~20^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fa390810e1fc6b80f936f57c4bed4a7056f18296;p=oweals%2Fu-boot.git efi_loader: Delete() return EFI_WARN_DELETE_FAILURE If EFI_FILE_PROTOCOL.Delete() fails, always close the handle and return EFI_WARN_DELETE_FAILURE. Signed-off-by: Heinrich Schuchardt --- diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 182d735e6b..36ca719a82 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -307,16 +307,10 @@ static efi_status_t EFIAPI efi_file_delete(struct efi_file_handle *file) EFI_ENTRY("%p", file); - if (set_blk_dev(fh)) { - ret = EFI_DEVICE_ERROR; - goto error; - } + if (set_blk_dev(fh) || fs_unlink(fh->path)) + ret = EFI_WARN_DELETE_FAILURE; - if (fs_unlink(fh->path)) - ret = EFI_DEVICE_ERROR; file_close(fh); - -error: return EFI_EXIT(ret); }