All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver
@ 2011-02-15  8:10 ` Shweta Gulati
  0 siblings, 0 replies; 7+ messages in thread
From: Shweta Gulati @ 2011-02-15  8:10 UTC (permalink / raw)
  To: linux-omap; +Cc: Shweta Gulati, linux-arm-kernel

This Patch frees all the dynamically allocated memory
which couldn't have been released in some error hitting cases.

Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 arch/arm/mach-omap2/smartreflex.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index a1f532e..5af8829 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -284,6 +284,7 @@ error:
 		dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
 			"interrupt handler. Smartreflex will"
 			"not function as desired\n", __func__);
+		kfree(name);
 		kfree(sr_info);
 		return ret;
 }
@@ -881,7 +882,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		ret = sr_late_init(sr_info);
 		if (ret) {
 			pr_warning("%s: Error in SR late init\n", __func__);
-			return ret;
+			goto err_release_region;
 		}
 	}
 
@@ -892,14 +893,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	 * not try to create rest of the debugfs entries.
 	 */
 	vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
-	if (!vdd_dbg_dir)
-		return -EINVAL;
+	if (!vdd_dbg_dir) {
+		ret = -EINVAL;
+		goto err_release_region;
+	}
 
 	dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
 	if (IS_ERR(dbg_dir)) {
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
 			__func__);
-		return PTR_ERR(dbg_dir);
+		ret = PTR_ERR(dbg_dir);
+		goto err_release_region;
 	}
 
 	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
@@ -915,7 +919,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	if (IS_ERR(nvalue_dir)) {
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
 			"for n-values\n", __func__);
-		return PTR_ERR(nvalue_dir);
+		ret = PTR_ERR(nvalue_dir);
+		goto err_release_region;
 	}
 
 	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
@@ -924,7 +929,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 			" corresponding vdd vdd_%s. Cannot create debugfs"
 			"entries for n-values\n",
 			__func__, sr_info->voltdm->name);
-		return -ENODATA;
+		ret = -ENODATA;
+		goto err_release_region;
 	}
 
 	for (i = 0; i < sr_info->nvalue_count; i++) {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver
@ 2011-02-15  8:10 ` Shweta Gulati
  0 siblings, 0 replies; 7+ messages in thread
From: Shweta Gulati @ 2011-02-15  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

This Patch frees all the dynamically allocated memory
which couldn't have been released in some error hitting cases.

Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>
Cc: linux-arm-kernel at lists.infradead.org
---
 arch/arm/mach-omap2/smartreflex.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index a1f532e..5af8829 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -284,6 +284,7 @@ error:
 		dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
 			"interrupt handler. Smartreflex will"
 			"not function as desired\n", __func__);
+		kfree(name);
 		kfree(sr_info);
 		return ret;
 }
@@ -881,7 +882,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		ret = sr_late_init(sr_info);
 		if (ret) {
 			pr_warning("%s: Error in SR late init\n", __func__);
-			return ret;
+			goto err_release_region;
 		}
 	}
 
@@ -892,14 +893,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	 * not try to create rest of the debugfs entries.
 	 */
 	vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
-	if (!vdd_dbg_dir)
-		return -EINVAL;
+	if (!vdd_dbg_dir) {
+		ret = -EINVAL;
+		goto err_release_region;
+	}
 
 	dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
 	if (IS_ERR(dbg_dir)) {
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
 			__func__);
-		return PTR_ERR(dbg_dir);
+		ret = PTR_ERR(dbg_dir);
+		goto err_release_region;
 	}
 
 	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
@@ -915,7 +919,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	if (IS_ERR(nvalue_dir)) {
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
 			"for n-values\n", __func__);
-		return PTR_ERR(nvalue_dir);
+		ret = PTR_ERR(nvalue_dir);
+		goto err_release_region;
 	}
 
 	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
@@ -924,7 +929,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 			" corresponding vdd vdd_%s. Cannot create debugfs"
 			"entries for n-values\n",
 			__func__, sr_info->voltdm->name);
-		return -ENODATA;
+		ret = -ENODATA;
+		goto err_release_region;
 	}
 
 	for (i = 0; i < sr_info->nvalue_count; i++) {
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver
  2011-02-15  8:10 ` Shweta Gulati
@ 2011-02-15 16:39   ` Kevin Hilman
  -1 siblings, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2011-02-15 16:39 UTC (permalink / raw)
  To: Shweta Gulati; +Cc: linux-omap, linux-arm-kernel

Shweta Gulati <shweta.gulati@ti.com> writes:

> This Patch frees all the dynamically allocated memory
> which couldn't have been released in some error hitting cases.
>
> Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>
> Cc: linux-arm-kernel@lists.infradead.org

Thanks, queuing as a fix for 2.6.38-rc (branch: for_2.6.38/pm-fixes)

Kevin

> ---
>  arch/arm/mach-omap2/smartreflex.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index a1f532e..5af8829 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -284,6 +284,7 @@ error:
>  		dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
>  			"interrupt handler. Smartreflex will"
>  			"not function as desired\n", __func__);
> +		kfree(name);
>  		kfree(sr_info);
>  		return ret;
>  }
> @@ -881,7 +882,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  		ret = sr_late_init(sr_info);
>  		if (ret) {
>  			pr_warning("%s: Error in SR late init\n", __func__);
> -			return ret;
> +			goto err_release_region;
>  		}
>  	}
>  
> @@ -892,14 +893,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	 * not try to create rest of the debugfs entries.
>  	 */
>  	vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
> -	if (!vdd_dbg_dir)
> -		return -EINVAL;
> +	if (!vdd_dbg_dir) {
> +		ret = -EINVAL;
> +		goto err_release_region;
> +	}
>  
>  	dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>  	if (IS_ERR(dbg_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>  			__func__);
> -		return PTR_ERR(dbg_dir);
> +		ret = PTR_ERR(dbg_dir);
> +		goto err_release_region;
>  	}
>  
>  	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
> @@ -915,7 +919,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (IS_ERR(nvalue_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>  			"for n-values\n", __func__);
> -		return PTR_ERR(nvalue_dir);
> +		ret = PTR_ERR(nvalue_dir);
> +		goto err_release_region;
>  	}
>  
>  	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
> @@ -924,7 +929,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  			" corresponding vdd vdd_%s. Cannot create debugfs"
>  			"entries for n-values\n",
>  			__func__, sr_info->voltdm->name);
> -		return -ENODATA;
> +		ret = -ENODATA;
> +		goto err_release_region;
>  	}
>  
>  	for (i = 0; i < sr_info->nvalue_count; i++) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver
@ 2011-02-15 16:39   ` Kevin Hilman
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2011-02-15 16:39 UTC (permalink / raw)
  To: linux-arm-kernel

Shweta Gulati <shweta.gulati@ti.com> writes:

> This Patch frees all the dynamically allocated memory
> which couldn't have been released in some error hitting cases.
>
> Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>
> Cc: linux-arm-kernel at lists.infradead.org

Thanks, queuing as a fix for 2.6.38-rc (branch: for_2.6.38/pm-fixes)

Kevin

> ---
>  arch/arm/mach-omap2/smartreflex.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index a1f532e..5af8829 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -284,6 +284,7 @@ error:
>  		dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
>  			"interrupt handler. Smartreflex will"
>  			"not function as desired\n", __func__);
> +		kfree(name);
>  		kfree(sr_info);
>  		return ret;
>  }
> @@ -881,7 +882,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  		ret = sr_late_init(sr_info);
>  		if (ret) {
>  			pr_warning("%s: Error in SR late init\n", __func__);
> -			return ret;
> +			goto err_release_region;
>  		}
>  	}
>  
> @@ -892,14 +893,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	 * not try to create rest of the debugfs entries.
>  	 */
>  	vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
> -	if (!vdd_dbg_dir)
> -		return -EINVAL;
> +	if (!vdd_dbg_dir) {
> +		ret = -EINVAL;
> +		goto err_release_region;
> +	}
>  
>  	dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>  	if (IS_ERR(dbg_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>  			__func__);
> -		return PTR_ERR(dbg_dir);
> +		ret = PTR_ERR(dbg_dir);
> +		goto err_release_region;
>  	}
>  
>  	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
> @@ -915,7 +919,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (IS_ERR(nvalue_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>  			"for n-values\n", __func__);
> -		return PTR_ERR(nvalue_dir);
> +		ret = PTR_ERR(nvalue_dir);
> +		goto err_release_region;
>  	}
>  
>  	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
> @@ -924,7 +929,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  			" corresponding vdd vdd_%s. Cannot create debugfs"
>  			"entries for n-values\n",
>  			__func__, sr_info->voltdm->name);
> -		return -ENODATA;
> +		ret = -ENODATA;
> +		goto err_release_region;
>  	}
>  
>  	for (i = 0; i < sr_info->nvalue_count; i++) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver.
  2011-02-08 11:52 Shweta Gulati
  2011-02-14  8:59 ` Gulati, Shweta
@ 2011-02-14 22:46 ` Kevin Hilman
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2011-02-14 22:46 UTC (permalink / raw)
  To: Shweta Gulati; +Cc: linux-omap

Shweta Gulati <shweta.gulati@ti.com> writes:

> This Patch frees all the dynamically allocated memory
> which couldn't have been released in some error hitting cases.
>
> Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>

Looks fine for 2.6.38-rc cycle.  Please repost with linux-arm-kernel in
Cc, and I'll queue it up.

Kevin

> ---
>  arch/arm/mach-omap2/smartreflex.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index d7deadf..a904625 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -282,6 +282,7 @@ error:
>  		dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
>  			"interrupt handler. Smartreflex will"
>  			"not function as desired\n", __func__);
> +		kfree(name);
>  		kfree(sr_info);
>  		return ret;
>  }
> @@ -880,7 +881,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  		ret = sr_late_init(sr_info);
>  		if (ret) {
>  			pr_warning("%s: Error in SR late init\n", __func__);
> -			return ret;
> +			goto err_release_region;
>  		}
>  	}
>  
> @@ -891,14 +892,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	 * not try to create rest of the debugfs entries.
>  	 */
>  	vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
> -	if (!vdd_dbg_dir)
> -		return -EINVAL;
> +	if (!vdd_dbg_dir) {
> +		ret = -EINVAL;
> +		goto err_release_region;
> +	}
>  
>  	dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>  	if (IS_ERR(dbg_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>  			__func__);
> -		return PTR_ERR(dbg_dir);
> +		ret = PTR_ERR(dbg_dir);
> +		goto err_release_region;
>  	}
>  
>  	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
> @@ -914,7 +918,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (IS_ERR(nvalue_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>  			"for n-values\n", __func__);
> -		return PTR_ERR(nvalue_dir);
> +		ret = PTR_ERR(nvalue_dir);
> +		goto err_release_region;
>  	}
>  
>  	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
> @@ -923,7 +928,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  			" corresponding vdd vdd_%s. Cannot create debugfs"
>  			"entries for n-values\n",
>  			__func__, sr_info->voltdm->name);
> -		return -ENODATA;
> +		ret = -ENODATA;
> +		goto err_release_region;
>  	}
>  
>  	for (i = 0; i < sr_info->nvalue_count; i++) {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver.
  2011-02-08 11:52 Shweta Gulati
@ 2011-02-14  8:59 ` Gulati, Shweta
  2011-02-14 22:46 ` Kevin Hilman
  1 sibling, 0 replies; 7+ messages in thread
From: Gulati, Shweta @ 2011-02-14  8:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Shweta Gulati

Any comments on this Patch??
On Tue, Feb 8, 2011 at 5:22 PM, Shweta Gulati <shweta.gulati@ti.com> wrote:
> This Patch frees all the dynamically allocated memory
> which couldn't have been released in some error hitting cases.
>
> Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>
> ---
>  arch/arm/mach-omap2/smartreflex.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index d7deadf..a904625 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -282,6 +282,7 @@ error:
>                dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
>                        "interrupt handler. Smartreflex will"
>                        "not function as desired\n", __func__);
> +               kfree(name);
>                kfree(sr_info);
>                return ret;
>  }
> @@ -880,7 +881,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>                ret = sr_late_init(sr_info);
>                if (ret) {
>                        pr_warning("%s: Error in SR late init\n", __func__);
> -                       return ret;
> +                       goto err_release_region;
>                }
>        }
>
> @@ -891,14 +892,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>         * not try to create rest of the debugfs entries.
>         */
>        vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
> -       if (!vdd_dbg_dir)
> -               return -EINVAL;
> +       if (!vdd_dbg_dir) {
> +               ret = -EINVAL;
> +               goto err_release_region;
> +       }
>
>        dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>        if (IS_ERR(dbg_dir)) {
>                dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>                        __func__);
> -               return PTR_ERR(dbg_dir);
> +               ret = PTR_ERR(dbg_dir);
> +               goto err_release_region;
>        }
>
>        (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
> @@ -914,7 +918,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>        if (IS_ERR(nvalue_dir)) {
>                dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>                        "for n-values\n", __func__);
> -               return PTR_ERR(nvalue_dir);
> +               ret = PTR_ERR(nvalue_dir);
> +               goto err_release_region;
>        }
>
>        omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
> @@ -923,7 +928,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>                        " corresponding vdd vdd_%s. Cannot create debugfs"
>                        "entries for n-values\n",
>                        __func__, sr_info->voltdm->name);
> -               return -ENODATA;
> +               ret = -ENODATA;
> +               goto err_release_region;
>        }
>
>        for (i = 0; i < sr_info->nvalue_count; i++) {
> --
> 1.7.0.4
>
>



-- 
Thanks,
Regards,
Shweta
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver.
@ 2011-02-08 11:52 Shweta Gulati
  2011-02-14  8:59 ` Gulati, Shweta
  2011-02-14 22:46 ` Kevin Hilman
  0 siblings, 2 replies; 7+ messages in thread
From: Shweta Gulati @ 2011-02-08 11:52 UTC (permalink / raw)
  To: linux-omap; +Cc: Shweta Gulati

This Patch frees all the dynamically allocated memory
which couldn't have been released in some error hitting cases.

Signed-off-by: Shweta Gulati <shweta.gulati@ti.com>
---
 arch/arm/mach-omap2/smartreflex.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index d7deadf..a904625 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -282,6 +282,7 @@ error:
 		dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
 			"interrupt handler. Smartreflex will"
 			"not function as desired\n", __func__);
+		kfree(name);
 		kfree(sr_info);
 		return ret;
 }
@@ -880,7 +881,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 		ret = sr_late_init(sr_info);
 		if (ret) {
 			pr_warning("%s: Error in SR late init\n", __func__);
-			return ret;
+			goto err_release_region;
 		}
 	}
 
@@ -891,14 +892,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	 * not try to create rest of the debugfs entries.
 	 */
 	vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
-	if (!vdd_dbg_dir)
-		return -EINVAL;
+	if (!vdd_dbg_dir) {
+		ret = -EINVAL;
+		goto err_release_region;
+	}
 
 	dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
 	if (IS_ERR(dbg_dir)) {
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
 			__func__);
-		return PTR_ERR(dbg_dir);
+		ret = PTR_ERR(dbg_dir);
+		goto err_release_region;
 	}
 
 	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
@@ -914,7 +918,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 	if (IS_ERR(nvalue_dir)) {
 		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
 			"for n-values\n", __func__);
-		return PTR_ERR(nvalue_dir);
+		ret = PTR_ERR(nvalue_dir);
+		goto err_release_region;
 	}
 
 	omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
@@ -923,7 +928,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
 			" corresponding vdd vdd_%s. Cannot create debugfs"
 			"entries for n-values\n",
 			__func__, sr_info->voltdm->name);
-		return -ENODATA;
+		ret = -ENODATA;
+		goto err_release_region;
 	}
 
 	for (i = 0; i < sr_info->nvalue_count; i++) {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-15 16:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-15  8:10 [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver Shweta Gulati
2011-02-15  8:10 ` Shweta Gulati
2011-02-15 16:39 ` Kevin Hilman
2011-02-15 16:39   ` Kevin Hilman
  -- strict thread matches above, loose matches on Subject: below --
2011-02-08 11:52 Shweta Gulati
2011-02-14  8:59 ` Gulati, Shweta
2011-02-14 22:46 ` Kevin Hilman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.