mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 22:51:35 +00:00
media: coda/imx-vdoa: Check for platform_get_resource() error
platform_get_resource() may fail and in this case a NULL dereference
will occur.
Prevent this from happening by returning an error on
platform_get_resource() failure.
Fixes: b0444f18e0
("[media] coda: add i.MX6 VDOA driver")
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
d088c3107e
commit
a874aabef9
@ -314,6 +314,8 @@ static int vdoa_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(vdoa->regs);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||
if (!res)
|
||||
return -EINVAL;
|
||||
vdoa->irq = devm_request_threaded_irq(&pdev->dev, res->start, NULL,
|
||||
vdoa_irq_handler, IRQF_ONESHOT,
|
||||
"vdoa", vdoa);
|
||||
|
Loading…
Reference in New Issue
Block a user