diff --git a/drivers/thermal/qcom/adc-tm.c b/drivers/thermal/qcom/adc-tm.c index d442ee3aae5e..f9dae59953ae 100644 --- a/drivers/thermal/qcom/adc-tm.c +++ b/drivers/thermal/qcom/adc-tm.c @@ -214,6 +214,9 @@ static int adc_tm_get_dt_data(struct platform_device *pdev, return -EINVAL; id = of_match_node(adc_tm_match_table, node); + if (!id) + return -EINVAL; + adc_tm->data = id->data; adc_tm->ops = adc_tm->data->ops;