Skip to content

Commit 128fdbf

Browse files
Manikanta Mylavarapuandersson
authored andcommitted
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 <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent f489f6c commit 128fdbf

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
@@ -786,7 +786,7 @@ static int qcom_socinfo_probe(struct platform_device *pdev)
786786
qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u",
787787
SOCINFO_MAJOR(le32_to_cpu(info->ver)),
788788
SOCINFO_MINOR(le32_to_cpu(info->ver)));
789-
if (!qs->attr.soc_id || qs->attr.revision)
789+
if (!qs->attr.soc_id || !qs->attr.revision)
790790
return -ENOMEM;
791791

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

0 commit comments

Comments
 (0)