diff options
author | Bryan Wu <pengw@nvidia.com> | 2014-04-02 13:40:19 -0700 |
---|---|---|
committer | Sachin Nikam <snikam@nvidia.com> | 2014-04-03 22:50:18 -0700 |
commit | 954780f95651acfdf0102faab168a20086312861 (patch) | |
tree | b0c7527fe4ac96c8d3c2e61c4f82963d29353e5e /drivers/media | |
parent | f6df6fd7409b89d1a283aa6a142bf978d771ba2b (diff) |
media: tegra_camera: free syncpts when probing fails
If driver probing fails, syncpts need to be freed for further use.
Otherwise it will cause syncpts leak.
Bug 1489488
Change-Id: I6f1ae10087b007c7f4814733e0e8f8b60c315fd6
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/391488
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/soc_camera/tegra_camera/common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/platform/soc_camera/tegra_camera/common.c b/drivers/media/platform/soc_camera/tegra_camera/common.c index 8ed262da1cf6..f0a250678cca 100644 --- a/drivers/media/platform/soc_camera/tegra_camera/common.c +++ b/drivers/media/platform/soc_camera/tegra_camera/common.c @@ -890,7 +890,7 @@ static int tegra_camera_probe(struct platform_device *pdev) dev_err(&pdev->dev, "%s: failed to map register base\n", __func__); err = -ENXIO; - goto exit_deinit_clk; + goto exit_free_syncpts; } nvhost_module_init(pdev); @@ -899,13 +899,13 @@ static int tegra_camera_probe(struct platform_device *pdev) if (err) { dev_err(&pdev->dev, "%s: nvhost init failed %d\n", __func__, err); - goto exit_deinit_clk; + goto exit_free_syncpts; } cam->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); if (IS_ERR(cam->alloc_ctx)) { err = PTR_ERR(cam->alloc_ctx); - goto exit_deinit_clk; + goto exit_free_syncpts; } platform_set_drvdata(pdev, cam); @@ -920,6 +920,8 @@ static int tegra_camera_probe(struct platform_device *pdev) exit_cleanup_alloc_ctx: platform_set_drvdata(pdev, cam->ndata); vb2_dma_contig_cleanup_ctx(cam->alloc_ctx); +exit_free_syncpts: + cam->ops->free_syncpts(cam); exit_deinit_clk: cam->ops->clks_deinit(cam); kfree(cam); |