summaryrefslogtreecommitdiff
path: root/drivers/ufs/core/ufs_bsg.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2025-11-11 10:47:59 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2025-11-12 20:58:28 -0500
commit18987143d4b1945a1bfcb3963ae1961ca29b27dd (patch)
treec5c5131d684ce6264eeff40c4739e6c2087eae48 /drivers/ufs/core/ufs_bsg.c
parent1028258914f608023279725d1756abf5b974e6d6 (diff)
scsi: ufs: core: Remove an unnecessary NULL pointer check
The !payload check tests the address of a member of a data structure. We know that the start address of this data structure (job) is not NULL since the 'job' pointer has already been dereferenced. Hence, the !payload check is superfluous. Remove this test. This was reported by the CodeSonar static analyzer. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20251111184802.125111-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/core/ufs_bsg.c')
-rw-r--r--drivers/ufs/core/ufs_bsg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ufs/core/ufs_bsg.c b/drivers/ufs/core/ufs_bsg.c
index 252186124669..58b506eac6dc 100644
--- a/drivers/ufs/core/ufs_bsg.c
+++ b/drivers/ufs/core/ufs_bsg.c
@@ -105,7 +105,7 @@ static int ufs_bsg_exec_advanced_rpmb_req(struct ufs_hba *hba, struct bsg_job *j
if (dir != DMA_NONE) {
payload = &job->request_payload;
- if (!payload || !payload->payload_len || !payload->sg_cnt)
+ if (!payload->payload_len || !payload->sg_cnt)
return -EINVAL;
sg_cnt = dma_map_sg(hba->host->dma_dev, payload->sg_list, payload->sg_cnt, dir);