[U-Boot] [PATCH v2 1/1] efi_loader: remove superfluous check in efi_setup_loaded_image()

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Mar 20 17:32:58 UTC 2019


It does not make any sense to check if a pointer is NULL if we have
dereferenced it before.

Reported-by: Coverity (CID 185827)
Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
v2
	change commit message to show Reported-by: Coverity
---
 lib/efi_loader/efi_boottime.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index bd8b8a17ae7..4fc550d9f37 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1581,10 +1581,8 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
 		goto failure;
 #endif

-	if (info_ptr)
-		*info_ptr = info;
-	if (handle_ptr)
-		*handle_ptr = obj;
+	*info_ptr = info;
+	*handle_ptr = obj;

 	return ret;
 failure:
--
2.20.1



More information about the U-Boot mailing list