efi_loader: remove superfluous NULL check in bootefi.c
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 20 Apr 2020 10:44:56 +0000 (12:44 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 30 Apr 2020 08:25:07 +0000 (10:25 +0200)
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@gmx.de>
cmd/bootefi.c

index aaed575505968b8f65b4ae89adf9e39b2e251b8e..54b4b8f98455a8af7ccb60abcf1ae8074d45d032 100644 (file)
@@ -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;
 }