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]
Message-Id: <1290415534.5471.8.camel@mola>
Date:	Mon, 22 Nov 2010 16:45:34 +0800
From:	Axel Lin <axel.lin@...il.com>
To:	linux-kernel <linux-kernel@...r.kernel.org>
Cc:	Nicolas Pitre <nico@...xnic.net>, Chris Ball <cjb@...top.org>,
	linux-mmc@...r.kernel.org
Subject: [PATCH 2/4] [ARM] mvsdio: fix a memory leak

request_mem_region() will call kzalloc to allocate memory for struct resource.
release_resource() unregisters the resource but does not free the allocated
memory, thus use release_mem_region() instead to fix the memory leak.

Signed-off-by: Axel Lin <axel.lin@...il.com>
---
 drivers/mmc/host/mvsdio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index a5bf60e..6a29972 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -825,7 +825,7 @@ out:
 			iounmap(host->base);
 	}
 	if (r)
-		release_resource(r);
+		release_mem_region(r->start, SZ_1K);
 	if (mmc)
 		mmc_free_host(mmc);
 
@@ -850,7 +850,7 @@ static int __exit mvsd_remove(struct platform_device *pdev)
 		del_timer_sync(&host->timer);
 		mvsd_power_down(host);
 		iounmap(host->base);
-		release_resource(host->res);
+		release_mem_region(host->res->start, SZ_1K);
 		mmc_free_host(mmc);
 	}
 	platform_set_drvdata(pdev, NULL);
-- 
1.7.2



--
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