lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 10 Jan 2010 01:01:03 +0800
From:	Américo Wang <xiyou.wangcong@...il.com>
To:	Alexander Beregalov <a.beregalov@...il.com>
Cc:	akpm@...ux-foundation.org, daniel@...aq.de,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: mxc: fix memory leak

On Sat, Jan 09, 2010 at 07:43:07PM +0300, Alexander Beregalov wrote:
>Free pdata before exit.
>Found by cppcheck.
>
>Signed-off-by: Alexander Beregalov <a.beregalov@...il.com>

This patch looks fine for me.

Reviewed-by: WANG Cong <xiyou.wangcong@...il.com>

Thanks!

>---
> drivers/rtc/rtc-mxc.c |    6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
>index 6bd5072..2642e6b 100644
>--- a/drivers/rtc/rtc-mxc.c
>+++ b/drivers/rtc/rtc-mxc.c
>@@ -396,8 +396,10 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
> 	pdata->ioaddr = ioremap(res->start, resource_size(res));
> 
> 	clk = clk_get(&pdev->dev, "ckil");
>-	if (IS_ERR(clk))
>-		return PTR_ERR(clk);
>+	if (IS_ERR(clk)) {
>+		ret = PTR_ERR(clk);
>+		goto exit_free_pdata;
>+	}
> 
> 	rate = clk_get_rate(clk);
> 	clk_put(clk);
>-- 
>1.6.6
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@...r.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

-- 
Live like a child, think like the god.
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ