Commit 4b4eda00 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman

Staging: media: Unmap and release region obtained by ioremap_nocache

Free memory mapping, if vpfe_ipipe_init is not successful.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7369e062
...@@ -1803,14 +1803,14 @@ vpfe_ipipe_init(struct vpfe_ipipe_device *ipipe, struct platform_device *pdev) ...@@ -1803,14 +1803,14 @@ vpfe_ipipe_init(struct vpfe_ipipe_device *ipipe, struct platform_device *pdev)
return -EBUSY; return -EBUSY;
ipipe->base_addr = ioremap_nocache(res->start, res_len); ipipe->base_addr = ioremap_nocache(res->start, res_len);
if (!ipipe->base_addr) if (!ipipe->base_addr)
return -EBUSY; goto error_release;
res = platform_get_resource(pdev, IORESOURCE_MEM, 6); res = platform_get_resource(pdev, IORESOURCE_MEM, 6);
if (!res) if (!res)
return -ENOENT; goto error_unmap;
ipipe->isp5_base_addr = ioremap_nocache(res->start, res_len); ipipe->isp5_base_addr = ioremap_nocache(res->start, res_len);
if (!ipipe->isp5_base_addr) if (!ipipe->isp5_base_addr)
return -EBUSY; goto error_unmap;
v4l2_subdev_init(sd, &ipipe_v4l2_ops); v4l2_subdev_init(sd, &ipipe_v4l2_ops);
sd->internal_ops = &ipipe_v4l2_internal_ops; sd->internal_ops = &ipipe_v4l2_internal_ops;
...@@ -1839,6 +1839,12 @@ vpfe_ipipe_init(struct vpfe_ipipe_device *ipipe, struct platform_device *pdev) ...@@ -1839,6 +1839,12 @@ vpfe_ipipe_init(struct vpfe_ipipe_device *ipipe, struct platform_device *pdev)
sd->ctrl_handler = &ipipe->ctrls; sd->ctrl_handler = &ipipe->ctrls;
return media_entity_pads_init(me, IPIPE_PADS_NUM, pads); return media_entity_pads_init(me, IPIPE_PADS_NUM, pads);
error_unmap:
iounmap(ipipe->base_addr);
error_release:
release_mem_region(res->start, res_len);
return -ENOMEM;
} }
/* /*
......
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