diff options
author | Julien Panis <jpanis@baylibre.com> | 2024-05-02 16:46:03 +0300 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2024-05-02 16:56:41 +0300 |
commit | a1191a77351e25ddf091bb1a231cae12ee598b5d (patch) | |
tree | c61b25c851ba12ecba19def5fb7db146020f0315 /drivers/thermal | |
parent | 734b5def91b594d3aa1147d60c45eded139ce2eb (diff) | |
download | linux-a1191a77351e25ddf091bb1a231cae12ee598b5d.tar.xz |
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
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/mediatek/lvts_thermal.c | 2 |
1 files changed, 2 insertions, 0 deletions
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)) |