提交 cdfaf475 编写于 作者: N Nadezda Lutovinova 提交者: Mauro Carvalho Chehab

media: s5p-mfc: Add checking to s5p_mfc_probe().

If of_device_get_match_data() return NULL,
then null pointer dereference occurs in  s5p_mfc_init_pm().
The patch adds checking if dev->variant is NULL.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NNadezda Lutovinova <lutovinova@ispras.ru>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
上级 7e360fa0
......@@ -1288,6 +1288,10 @@ static int s5p_mfc_probe(struct platform_device *pdev)
}
dev->variant = of_device_get_match_data(&pdev->dev);
if (!dev->variant) {
dev_err(&pdev->dev, "Failed to get device MFC hardware variant information\n");
return -ENOENT;
}
dev->regs_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(dev->regs_base))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册