diff options
author | Alison Schofield <alison.schofield@intel.com> | 2022-03-03 15:16:57 -0800 |
---|---|---|
committer | Vishal Verma <vishal.l.verma@intel.com> | 2022-03-03 17:08:48 -0700 |
commit | 4b381a31345930d08ab9adb87087bb765f624506 (patch) | |
tree | 5f41f64fd9ef807ee5ecdc3b969617c23f960652 | |
parent | 3b5fb8b6428dfaab39bab58d67412427f514c1f4 (diff) |
libcxl: Remove extraneous NULL checks when validating cmd status
When a cxl_cmd_new_*() function is executed the returned command
pointer is always checked for NULL. Remove extraneous NULL checks
later in the command validation path.
Coverity pointed these out as 'check_after_deref' issues.
Link: https://lore.kernel.org/r/20220303231657.1053594-1-alison.schofield@intel.com
Fixes: 4f588b964dcc ("libcxl: add GET_PARTITION_INFO mailbox command and accessors")
Fixes: 50b9d77232d4 ("libcxl: add accessors for capacity fields of the IDENTIFY command")
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
-rw-r--r-- | cxl/lib/libcxl.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c index daa2bbc5..f111d868 100644 --- a/cxl/lib/libcxl.c +++ b/cxl/lib/libcxl.c @@ -2283,8 +2283,6 @@ cmd_to_identify(struct cxl_cmd *cmd) if (cxl_cmd_validate_status(cmd, CXL_MEM_COMMAND_ID_IDENTIFY)) return NULL; - if (!cmd) - return NULL; return cmd->output_payload; } @@ -2429,8 +2427,6 @@ cmd_to_get_partition(struct cxl_cmd *cmd) if (cxl_cmd_validate_status(cmd, CXL_MEM_COMMAND_ID_GET_PARTITION_INFO)) return NULL; - if (!cmd) - return NULL; return cmd->output_payload; } |