Stable Archive mirror
 help / color / mirror / Atom feed
From: "thermal-bot for Konrad Dybcio" <tip-bot2@linutronix.de>
To: linux-pm@vger.kernel.org
Cc: <stable@vger.kernel.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	rui.zhang@intel.com, amitk@kernel.org
Subject: [thermal: thermal/fixes] thermal/drivers/qcom/lmh: Check for SCM availability at probe
Date: Tue, 14 May 2024 10:18:56 -0000	[thread overview]
Message-ID: <171568193607.10875.2373863921021975776.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240308-topic-rb1_lmh-v2-2-bac3914b0fe3@linaro.org>

The following commit has been merged into the thermal/fixes branch of thermal:

Commit-ID:     d9d3490c48df572edefc0b64655259eefdcbb9be
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//d9d3490c48df572edefc0b64655259eefdcbb9be
Author:        Konrad Dybcio <konrad.dybcio@linaro.org>
AuthorDate:    Sat, 09 Mar 2024 14:15:03 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 23 Apr 2024 12:40:29 +02:00

thermal/drivers/qcom/lmh: Check for SCM availability at probe

Up until now, the necessary scm availability check has not been
performed, leading to possible null pointer dereferences (which did
happen for me on RB1).

Fix that.

Fixes: 53bca371cdf7 ("thermal/drivers/qcom: Add support for LMh driver")
Cc: <stable@vger.kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20240308-topic-rb1_lmh-v2-2-bac3914b0fe3@linaro.org
---
 drivers/thermal/qcom/lmh.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/qcom/lmh.c b/drivers/thermal/qcom/lmh.c
index f6edb12..5225b36 100644
--- a/drivers/thermal/qcom/lmh.c
+++ b/drivers/thermal/qcom/lmh.c
@@ -95,6 +95,9 @@ static int lmh_probe(struct platform_device *pdev)
 	unsigned int enable_alg;
 	u32 node_id;
 
+	if (!qcom_scm_is_available())
+		return -EPROBE_DEFER;
+
 	lmh_data = devm_kzalloc(dev, sizeof(*lmh_data), GFP_KERNEL);
 	if (!lmh_data)
 		return -ENOMEM;

  parent reply	other threads:[~2024-05-14 10:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 13:15 [PATCH v2 0/3] QCM2290 LMH Konrad Dybcio
2024-03-09 13:15 ` [PATCH v2 2/3] thermal: qcom: lmh: Check for SCM availability at probe Konrad Dybcio
2024-03-18  1:27   ` Bjorn Andersson
2024-03-21 17:13   ` Daniel Lezcano
2024-05-14 10:18   ` thermal-bot for Konrad Dybcio [this message]
2024-03-19  2:48 ` (subset) [PATCH v2 0/3] QCM2290 LMH Bjorn Andersson
2024-03-20 19:08 ` Nícolas F. R. A. Prado
2024-03-25 19:48   ` Konrad Dybcio
2024-03-25 19:59   ` Krzysztof Kozlowski
2024-03-25 23:01     ` Nícolas F. R. A. Prado
2024-03-26  6:29       ` Krzysztof Kozlowski
2024-03-26 14:07         ` Nícolas F. R. A. Prado
2024-03-27  4:04           ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=171568193607.10875.2373863921021975776.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=amitk@kernel.org \
    --cc=andersson@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).