mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
media: s5p-mfc: Add checking to s5p_mfc_probe().
[ Upstream commit cdfaf4752e ]
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: Nadezda Lutovinova <lutovinova@ispras.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b570e36a77
commit
a62edd8390
|
|
@ -1288,6 +1288,10 @@ static int s5p_mfc_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->variant = of_device_get_match_data(&pdev->dev);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
|
dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user