[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240502-mtk-thermal-lvts-data-v1-1-65f1b0bfad37@baylibre.com>
Date: Thu, 02 May 2024 15:46:03 +0200
From: Julien Panis <jpanis@...libre.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>,
Lukasz Luba <lukasz.luba@....com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Nicolas Pitre <npitre@...libre.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
Julien Panis <jpanis@...libre.com>
Subject: [PATCH] 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@...libre.com>
---
At probe, verify that lvts_data is not NULL before using it.
---
drivers/thermal/mediatek/lvts_thermal.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index 86b2f44355ac..20a64b68f9c0 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))
---
base-commit: 9c6ecb3cb6e20c4fd7997047213ba0efcf9ada1a
change-id: 20240502-mtk-thermal-lvts-data-4b19d0685024
Best regards,
--
Julien Panis <jpanis@...libre.com>
Powered by blists - more mailing lists