提交 8b051ec3 编写于 作者: S Shailendra Verma 提交者: Eduardo Valentin

thermal: imx: Fix possible NULL dereference.

of_device_get_match_data could return NULL, and so can cause
a NULL pointer dereference later.
Signed-off-by: NShailendra Verma <shailendra.v@samsung.com>
Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
上级 ef9b36d9
......@@ -489,6 +489,10 @@ static int imx_thermal_probe(struct platform_device *pdev)
data->tempmon = map;
data->socdata = of_device_get_match_data(&pdev->dev);
if (!data->socdata) {
dev_err(&pdev->dev, "no device match found\n");
return -ENODEV;
}
/* make sure the IRQ flag is clear before enabling irq on i.MX6SX */
if (data->socdata->version == TEMPMON_IMX6SX) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册