From 48d55fdbbda5a3963d8c7a644a31d07b03893f5f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 2 Dec 2024 14:44:22 +0100 Subject: [PATCH] 5.4-stable patches added patches: soc-qcom-socinfo-fix-revision-check-in-qcom_socinfo_probe.patch --- queue-5.4/series | 1 + ...revision-check-in-qcom_socinfo_probe.patch | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 queue-5.4/soc-qcom-socinfo-fix-revision-check-in-qcom_socinfo_probe.patch diff --git a/queue-5.4/series b/queue-5.4/series index c9727c3b141..b5cd31c63fe 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -144,3 +144,4 @@ apparmor-fix-do-simple-duplicate-message-elimination.patch usb-ehci-spear-fix-call-balance-of-sehci-clk-handling-routines.patch cgroup-make-operations-on-the-cgroup-root_list-rcu-safe.patch cgroup-move-rcu_head-up-near-the-top-of-cgroup_root.patch +soc-qcom-socinfo-fix-revision-check-in-qcom_socinfo_probe.patch diff --git a/queue-5.4/soc-qcom-socinfo-fix-revision-check-in-qcom_socinfo_probe.patch b/queue-5.4/soc-qcom-socinfo-fix-revision-check-in-qcom_socinfo_probe.patch new file mode 100644 index 00000000000..cd6e22ecedf --- /dev/null +++ b/queue-5.4/soc-qcom-socinfo-fix-revision-check-in-qcom_socinfo_probe.patch @@ -0,0 +1,42 @@ +From 128fdbf36cddc2a901c4889ba1c89fa9f2643f2c Mon Sep 17 00:00:00 2001 +From: Manikanta Mylavarapu +Date: Wed, 16 Oct 2024 20:18:52 +0530 +Subject: soc: qcom: socinfo: fix revision check in qcom_socinfo_probe() + +From: Manikanta Mylavarapu + +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 +Reviewed-by: Konrad Dybcio +Link: https://lore.kernel.org/r/20241016144852.2888679-1-quic_mmanikan@quicinc.com +Signed-off-by: Bjorn Andersson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/qcom/socinfo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/soc/qcom/socinfo.c ++++ b/drivers/soc/qcom/socinfo.c +@@ -433,7 +433,7 @@ static int qcom_socinfo_probe(struct pla + qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u", + SOCINFO_MAJOR(le32_to_cpu(info->ver)), + SOCINFO_MINOR(le32_to_cpu(info->ver))); +- if (!qs->attr.soc_id || qs->attr.revision) ++ if (!qs->attr.soc_id || !qs->attr.revision) + return -ENOMEM; + + if (offsetof(struct socinfo, serial_num) <= item_size) { -- 2.47.3