summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-08-24 09:53:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 11:55:02 +0300
commit7cfd9b85b72b561912a9812ff7da7cb74a8cf82a (patch)
treee5f5aa8f96307daa49c4b83297b72da032fb3566 /drivers
parent26c139c2eab3add1fd1b8802edbc4459c8bd8e46 (diff)
downloadlinux-7cfd9b85b72b561912a9812ff7da7cb74a8cf82a.tar.xz
media: omap3isp: Fix memleak in isp_probe
[ Upstream commit d8fc21c17099635e8ebd986d042be65a6c6b5bd0 ] When devm_ioremap_resource() fails, isp should be freed just like other error paths in isp_probe. Fixes: 8644cdf972dd6 ("[media] omap3isp: Replace many MMIO regions by two") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/omap3isp/isp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index addd03b51748..00e52f0b8251 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2265,8 +2265,10 @@ static int isp_probe(struct platform_device *pdev)
mem = platform_get_resource(pdev, IORESOURCE_MEM, i);
isp->mmio_base[map_idx] =
devm_ioremap_resource(isp->dev, mem);
- if (IS_ERR(isp->mmio_base[map_idx]))
- return PTR_ERR(isp->mmio_base[map_idx]);
+ if (IS_ERR(isp->mmio_base[map_idx])) {
+ ret = PTR_ERR(isp->mmio_base[map_idx]);
+ goto error;
+ }
}
ret = isp_get_clocks(isp);