diff mbox series

[thermal:,thermal/fixes] thermal/drivers/mediatek/lvts_thermal: Check NULL ptr on lvts_data

Message ID 171568193258.10875.15198718649707261237.tip-bot2@tip-bot2 (mailing list archive)
State Not Applicable, archived
Headers show
Series [thermal:,thermal/fixes] thermal/drivers/mediatek/lvts_thermal: Check NULL ptr on lvts_data | expand

Commit Message

thermal-bot for Stanislaw Gruszka May 14, 2024, 10:18 a.m. UTC
The following commit has been merged into the thermal/fixes branch of thermal:

Commit-ID:     a1191a77351e25ddf091bb1a231cae12ee598b5d
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//a1191a77351e25ddf091bb1a231cae12ee598b5d
Author:        Julien Panis <jpanis@baylibre.com>
AuthorDate:    Thu, 02 May 2024 15:46:03 +02:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 02 May 2024 15:56:41 +02:00

thermal/drivers/mediatek/lvts_thermal: Check NULL ptr on lvts_data

Verify that lvts_data is not NULL before using it.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20240502-mtk-thermal-lvts-data-v1-1-65f1b0bfad37@baylibre.com
---
 drivers/thermal/mediatek/lvts_thermal.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index 86b2f44..20a64b6 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -1271,6 +1271,8 @@  static int lvts_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	lvts_data = of_device_get_match_data(dev);
+	if (!lvts_data)
+		return -ENODEV;
 
 	lvts_td->clk = devm_clk_get_enabled(dev, NULL);
 	if (IS_ERR(lvts_td->clk))