projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3dca77b
)
efi_loader: efi_capsule_delete_file() NULL dereference
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Wed, 2 Jun 2021 17:28:22 +0000
(19:28 +0200)
committer
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Tue, 8 Jun 2021 22:16:39 +0000
(
00:16
+0200)
If opening a file fails, the file handle pointer is not valid and must not
be dereferenced.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_capsule.c
patch
|
blob
|
history
diff --git
a/lib/efi_loader/efi_capsule.c
b/lib/efi_loader/efi_capsule.c
index 9ead0d2c7816e4627904eb3e9105c6481fa28288..60309d4a07d08e55130cc6e9f48a978772dcc5d1 100644
(file)
--- 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;
}