]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
soc: qcom: socinfo: fix revision check in qcom_socinfo_probe()
authorManikanta Mylavarapu <quic_mmanikan@quicinc.com>
Wed, 16 Oct 2024 14:48:52 +0000 (20:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:12 +0000 (19:51 +0100)
commitca0d15ee5a682ab07a49fa8f7f5030e931d72ca3
treef9f500edb40abbc14b3fa2258e4c895126b63f09
parent9b26540820e56fbc4736253d84f2670dcccad597
soc: qcom: socinfo: fix revision check in qcom_socinfo_probe()

commit 128fdbf36cddc2a901c4889ba1c89fa9f2643f2c upstream.

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: e694d2b5c58b ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/soc/qcom/socinfo.c