Skip to content

Commit c8be073

Browse files
Asutosh Dasmartinkpetersen
authored andcommitted
scsi: ufs: mcq: qcom: Fix passing zero to PTR_ERR
Fix an error case in ufs_qcom_mcq_config_resource(), where the return value is set to 0 before passing it to PTR_ERR. This led to Smatch warning: drivers/ufs/host/ufs-qcom.c:1455 ufs_qcom_mcq_config_resource() warn: passing zero to 'PTR_ERR' Fixes: c263b4e ("scsi: ufs: core: mcq: Configure resource regions") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Asutosh Das <[email protected]> Link: https://lore.kernel.org/r/94ca99b327af634799ce5f25d0112c28cd00970d.1677721072.git.quic_asutoshd@quicinc.com Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent fa8d327 commit c8be073

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ufs/host/ufs-qcom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,8 +1451,8 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
14511451
if (IS_ERR(res->base)) {
14521452
dev_err(hba->dev, "Failed to map res %s, err=%d\n",
14531453
res->name, (int)PTR_ERR(res->base));
1454-
res->base = NULL;
14551454
ret = PTR_ERR(res->base);
1455+
res->base = NULL;
14561456
return ret;
14571457
}
14581458
}

0 commit comments

Comments
 (0)