Blame SOURCES/0143-libcxl-Remove-extraneous-NULL-checks-when-validating.patch

2eb93d
From 4b381a31345930d08ab9adb87087bb765f624506 Mon Sep 17 00:00:00 2001
2eb93d
From: Alison Schofield <alison.schofield@intel.com>
2eb93d
Date: Thu, 3 Mar 2022 15:16:57 -0800
2eb93d
Subject: [PATCH 143/217] libcxl: Remove extraneous NULL checks when validating
2eb93d
 cmd status
2eb93d
2eb93d
When a cxl_cmd_new_*() function is executed the returned command
2eb93d
pointer is always checked for NULL. Remove extraneous NULL checks
2eb93d
later in the command validation path.
2eb93d
2eb93d
Coverity pointed these out as 'check_after_deref' issues.
2eb93d
2eb93d
Link: https://lore.kernel.org/r/20220303231657.1053594-1-alison.schofield@intel.com
2eb93d
Fixes: 4f588b964dcc ("libcxl: add GET_PARTITION_INFO mailbox command and accessors")
2eb93d
Fixes: 50b9d77232d4 ("libcxl: add accessors for capacity fields of the IDENTIFY command")
2eb93d
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
2eb93d
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
2eb93d
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
2eb93d
---
2eb93d
 cxl/lib/libcxl.c | 4 ----
2eb93d
 1 file changed, 4 deletions(-)
2eb93d
2eb93d
diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
2eb93d
index daa2bbc..f111d86 100644
2eb93d
--- a/cxl/lib/libcxl.c
2eb93d
+++ b/cxl/lib/libcxl.c
2eb93d
@@ -2283,8 +2283,6 @@ cmd_to_identify(struct cxl_cmd *cmd)
2eb93d
 	if (cxl_cmd_validate_status(cmd, CXL_MEM_COMMAND_ID_IDENTIFY))
2eb93d
 		return NULL;
2eb93d
 
2eb93d
-	if (!cmd)
2eb93d
-		return NULL;
2eb93d
 	return cmd->output_payload;
2eb93d
 }
2eb93d
 
2eb93d
@@ -2429,8 +2427,6 @@ cmd_to_get_partition(struct cxl_cmd *cmd)
2eb93d
 	if (cxl_cmd_validate_status(cmd, CXL_MEM_COMMAND_ID_GET_PARTITION_INFO))
2eb93d
 		return NULL;
2eb93d
 
2eb93d
-	if (!cmd)
2eb93d
-		return NULL;
2eb93d
 	return cmd->output_payload;
2eb93d
 }
2eb93d
 
2eb93d
-- 
2eb93d
2.27.0
2eb93d