Skip to content

Commit a15aaa9

Browse files
committed
soc: qcom: socinfo: fix revision check in qcom_socinfo_probe()
JIRA: https://issues.redhat.com/browse/RHEL-85597 commit 128fdbf Author: Manikanta Mylavarapu <quic_mmanikan@quicinc.com> Date: Wed Oct 16 20:18:52 2024 +0530 soc: qcom: socinfo: fix revision check in qcom_socinfo_probe() In success case, the revision holds a non-null pointer. The current logic incorrectly returns an error for a non-null pointer, whereas it should return an error for a null pointer. The socinfo driver for IPQ9574 and IPQ5332 is currently broken, resulting in the following error message qcom-socinfo qcom-socinfo: probe with driver qcom-socinfo failed with error -12 Add a null check for the revision to ensure it returns an error only in failure case (null pointer). Fixes: e694d2b ("soc: qcom: Add check devm_kasprintf() returned value") Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20241016144852.2888679-1-quic_mmanikan@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Jared Kangas <jkangas@redhat.com>
1 parent aa783ab commit a15aaa9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/soc/qcom/socinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static int qcom_socinfo_probe(struct platform_device *pdev)
614614
qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u",
615615
SOCINFO_MAJOR(le32_to_cpu(info->ver)),
616616
SOCINFO_MINOR(le32_to_cpu(info->ver)));
617-
if (!qs->attr.soc_id || qs->attr.revision)
617+
if (!qs->attr.soc_id || !qs->attr.revision)
618618
return -ENOMEM;
619619

620620
if (offsetof(struct socinfo, serial_num) <= item_size) {

0 commit comments

Comments
 (0)