Skip to content

Commit a1191a7

Browse files
jpanisbldlezcano
authored andcommitted
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 <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 734b5de commit a1191a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/thermal/mediatek/lvts_thermal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,8 @@ static int lvts_probe(struct platform_device *pdev)
12711271
return -ENOMEM;
12721272

12731273
lvts_data = of_device_get_match_data(dev);
1274+
if (!lvts_data)
1275+
return -ENODEV;
12741276

12751277
lvts_td->clk = devm_clk_get_enabled(dev, NULL);
12761278
if (IS_ERR(lvts_td->clk))

0 commit comments

Comments
 (0)