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

[ Upstream commit a1191a77351e25ddf091bb1a231cae12ee598b5d ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Julien Panis 2024-05-02 15:46:03 +02:00 committed by Greg Kroah-Hartman
parent 547cb99314
commit 79ef1a5593
1 changed files with 2 additions and 0 deletions

View File

@ -1208,6 +1208,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))