Commit c8be073b authored by Asutosh Das's avatar Asutosh Das Committed by Martin K. Petersen

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: c263b4ef ("scsi: ufs: core: mcq: Configure resource regions")
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarAsutosh Das <quic_asutoshd@quicinc.com>
Link: https://lore.kernel.org/r/94ca99b327af634799ce5f25d0112c28cd00970d.1677721072.git.quic_asutoshd@quicinc.comReviewed-by: default avatarBjorn Andersson <andersson@kernel.org>
Reviewed-by: default avatarManivannan Sadhasivam <mani@kernel.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent fa8d3272
...@@ -1451,8 +1451,8 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba) ...@@ -1451,8 +1451,8 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
if (IS_ERR(res->base)) { if (IS_ERR(res->base)) {
dev_err(hba->dev, "Failed to map res %s, err=%d\n", dev_err(hba->dev, "Failed to map res %s, err=%d\n",
res->name, (int)PTR_ERR(res->base)); res->name, (int)PTR_ERR(res->base));
res->base = NULL;
ret = PTR_ERR(res->base); ret = PTR_ERR(res->base);
res->base = NULL;
return ret; return ret;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment