diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-06-02 19:28:22 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-06-09 00:16:39 +0200 |
commit | e27b0ff1b7135f966c1379acde48134dd6b15545 (patch) | |
tree | 82243d43a5abb1e3a9ac098342846d1032c8df5d /lib | |
parent | 3dca77b1dc1b6dbf9c8b51572fe4b0553cef009f (diff) | |
download | u-boot-e27b0ff1b7135f966c1379acde48134dd6b15545.tar.gz u-boot-e27b0ff1b7135f966c1379acde48134dd6b15545.tar.bz2 u-boot-e27b0ff1b7135f966c1379acde48134dd6b15545.zip |
efi_loader: efi_capsule_delete_file() NULL dereference
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_capsule.c | 3 |
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; } |