Commit a874aabe authored by Fabio Estevam's avatar Fabio Estevam Committed by Mauro Carvalho Chehab

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: b0444f18 ("[media] coda: add i.MX6 VDOA driver")
Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d088c310
...@@ -314,6 +314,8 @@ static int vdoa_probe(struct platform_device *pdev) ...@@ -314,6 +314,8 @@ static int vdoa_probe(struct platform_device *pdev)
return PTR_ERR(vdoa->regs); return PTR_ERR(vdoa->regs);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 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 = devm_request_threaded_irq(&pdev->dev, res->start, NULL,
vdoa_irq_handler, IRQF_ONESHOT, vdoa_irq_handler, IRQF_ONESHOT,
"vdoa", vdoa); "vdoa", vdoa);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment