fimc-is: Fix possible memory leak found by static analysis
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 23 Nov 2015 12:55:49 +0000 (13:55 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 27 Apr 2018 08:25:07 +0000 (10:25 +0200)
This patch fixes all issues pointed by Klocwork static analysis tool.

Change-Id: Ie0d80a2bbd514c6dac0959784623d380ea580b19
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
drivers/media/platform/exynos/fimc-is/fimc-is-device-csi.c
drivers/media/platform/exynos/fimc-is/setup-fimc-is.c

index cf712ebbae40646e02ad8f13049cdc22df04b996..7ef4e5b75d40bf2079b53b19314b5ac623afeb81 100644 (file)
@@ -363,7 +363,7 @@ int fimc_is_csi_probe(void *parent, u32 instance)
        csi->phy = devm_phy_get(&device->pdev->dev, "csis");
        if (IS_ERR(csi->phy)) {
                ret = PTR_ERR(csi->phy);
-               goto p_err_free1;
+               goto p_err_free2;
        }
 
        csi->instance = instance;
index 63d54889fab4fd486fb7b647dc94fe15c1fa1952..8699f5a64bda5506fa565089e0899ff455330755 100644 (file)
@@ -43,13 +43,13 @@ int fimc_is_set_parent_dt(struct platform_device *pdev,
        struct clk *p;
        struct clk *c;
 
-       p = clk_get(&pdev->dev, parent);
+       p = devm_clk_get(&pdev->dev, parent);
        if (IS_ERR(p)) {
                pr_err("%s: could not lookup clock : %s\n", __func__, parent);
                return -EINVAL;
        }
 
-       c = clk_get(&pdev->dev, child);
+       c = devm_clk_get(&pdev->dev, child);
        if (IS_ERR(c)) {
                pr_err("%s: could not lookup clock : %s\n", __func__, child);
                return -EINVAL;
@@ -64,7 +64,7 @@ int fimc_is_set_rate_dt(struct platform_device *pdev,
 {
        struct clk *target;
 
-       target = clk_get(&pdev->dev, conid);
+       target = devm_clk_get(&pdev->dev, conid);
        if (IS_ERR(target)) {
                pr_err("%s: could not lookup clock : %s\n", __func__, conid);
                return -EINVAL;
@@ -80,7 +80,7 @@ unsigned int  fimc_is_get_rate_dt(struct platform_device *pdev,
        struct clk *target;
        unsigned int rate_target;
 
-       target = clk_get(&pdev->dev, conid);
+       target = devm_clk_get(&pdev->dev, conid);
        if (IS_ERR(target)) {
                pr_err("%s: could not lookup clock : %s\n", __func__, conid);
                return -EINVAL;
@@ -98,7 +98,7 @@ unsigned int  fimc_is_enable_dt(struct platform_device *pdev,
 {
        struct clk *target;
 
-       target = clk_get(&pdev->dev, conid);
+       target = devm_clk_get(&pdev->dev, conid);
        if (IS_ERR(target)) {
                pr_err("%s: could not lookup clock : %s\n", __func__, conid);
                return -EINVAL;
@@ -115,7 +115,7 @@ void  fimc_is_disable_dt(struct platform_device *pdev,
 {
        struct clk *target;
 
-       target = clk_get(&pdev->dev, conid);
+       target = devm_clk_get(&pdev->dev, conid);
        if (IS_ERR(target)) {
                pr_err("%s: could not lookup clock : %s\n", __func__, conid);
        }