public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: omap_hsmmc: release correct resource
@ 2012-04-18  9:49 Venkatraman S
  2012-04-18  9:49 ` [PATCH 2/3] mmc: omap_hsmmc: Add fclk frequency to debufs Venkatraman S
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Venkatraman S @ 2012-04-18  9:49 UTC (permalink / raw)
  To: cjb
  Cc: linux-mmc, linux-omap, Russell King - ARM Linux, Russell King,
	Venkatraman S

From: Russell King - ARM Linux <linux@arm.linux.org.uk>

res can be one of several resources, as this variable is re-used several
times during probe.  This can cause the wrong resource parameters to be
passed to release_mem_region().

Get the original memory resource before calling release_mem_region().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4254b6f..d15b149 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2042,7 +2042,9 @@ err1:
 err_alloc:
 	omap_hsmmc_gpio_free(pdata);
 err:
-	release_mem_region(res->start, resource_size(res));
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (res)
+		release_mem_region(res->start, resource_size(res));
 	return ret;
 }
 
-- 
1.7.10.rc2


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

end of thread, other threads:[~2012-04-19  4:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18  9:49 [PATCH 1/3] mmc: omap_hsmmc: release correct resource Venkatraman S
2012-04-18  9:49 ` [PATCH 2/3] mmc: omap_hsmmc: Add fclk frequency to debufs Venkatraman S
2012-04-19  0:04   ` Chris Ball
2012-04-19  4:25     ` S, Venkatraman
2012-04-19  4:36       ` Chris Ball
2012-04-19  4:53       ` [PATCH 1/2] " Venkatraman S
2012-04-18  9:49 ` [PATCH 3/3] mmc: omap_hsmmc: If probe fails, give out error messages Venkatraman S
2012-04-18  9:58 ` [PATCH 1/3] mmc: omap_hsmmc: release correct resource Russell King - ARM Linux
2012-04-18 10:26   ` S, Venkatraman
2012-04-18 10:27 ` [PATCH] " Venkatraman S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox