Skip to content

Commit d9d3490

Browse files
konradybciodlezcano
authored andcommitted
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: 53bca37 ("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
1 parent c0f14ec commit d9d3490

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • drivers/thermal/qcom

drivers/thermal/qcom/lmh.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ static int lmh_probe(struct platform_device *pdev)
9595
unsigned int enable_alg;
9696
u32 node_id;
9797

98+
if (!qcom_scm_is_available())
99+
return -EPROBE_DEFER;
100+
98101
lmh_data = devm_kzalloc(dev, sizeof(*lmh_data), GFP_KERNEL);
99102
if (!lmh_data)
100103
return -ENOMEM;

0 commit comments

Comments
 (0)