diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2017-08-17 03:14:07 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-08-20 15:26:53 +0300 |
commit | a874aabef9337f26c589858e7ea0ec6a6adbb129 (patch) | |
tree | 9ad7dbb4c3bf914ffe4fc28066c540cab10d7c0e | |
parent | d088c3107e9718ca3271277693f80a42d4effe51 (diff) | |
download | linux-a874aabef9337f26c589858e7ea0ec6a6adbb129.tar.xz |
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: b0444f18e0b18abce ("[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>
-rw-r--r-- | drivers/media/platform/coda/imx-vdoa.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/imx-vdoa.c b/drivers/media/platform/coda/imx-vdoa.c index df9b71621420..8eb3e0c05473 100644 --- a/drivers/media/platform/coda/imx-vdoa.c +++ b/drivers/media/platform/coda/imx-vdoa.c @@ -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); |