From: Kevin Hilman <khilman@ti.com>
To: Shweta Gulati <shweta.gulati@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver.
Date: Mon, 14 Feb 2011 14:46:16 -0800 [thread overview]
Message-ID: <877hd2z13b.fsf@ti.com> (raw)
In-Reply-To: <1297165948-28386-1-git-send-email-shweta.gulati@ti.com> (Shweta Gulati's message of "Tue, 8 Feb 2011 17:22:28 +0530")
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++) {
next prev parent reply other threads:[~2011-02-14 22:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-08 11:52 [PATCH] OMAP: Fix Memory Leaks in Smartreflex driver Shweta Gulati
2011-02-14 8:59 ` Gulati, Shweta
2011-02-14 22:46 ` Kevin Hilman [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-02-15 8:10 Shweta Gulati
2011-02-15 16:39 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877hd2z13b.fsf@ti.com \
--to=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=shweta.gulati@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox