diff mbox series

efi_loader: remove superfluous NULL check in bootefi.c

Message ID 20200420104701.5770-1-xypron.glpk@gmx.de
State Accepted
Commit 4fe050e65f61cc5e7734aee0637a18ac16b10061
Headers show
Series efi_loader: remove superfluous NULL check in bootefi.c | expand

Commit Message

Heinrich Schuchardt April 20, 2020, 10:47 a.m. UTC
efi_free_pool() and efi_delete_handle() both check if their argument is
NULL. The caller should not duplicate this check.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 cmd/bootefi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--
2.25.1
diff mbox series

Patch

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index aaed575505..54b4b8f984 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -481,10 +481,8 @@  efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
 	ret = do_bootefi_exec(handle);

 out:
-	if (mem_handle)
-		efi_delete_handle(mem_handle);
-	if (file_path)
-		efi_free_pool(file_path);
+	efi_delete_handle(mem_handle);
+	efi_free_pool(file_path);
 	return ret;
 }