All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: omap_hsmmc: release correct resource
@ 2012-04-14 13:41 ` Russell King - ARM Linux
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2012-04-14 13:41 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel

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>
---
 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 d12bdbe..4b2e1f0 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2027,7 +2027,9 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 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;
 }
 

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

* [PATCH] mmc: omap_hsmmc: release correct resource
@ 2012-04-14 13:41 ` Russell King - ARM Linux
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2012-04-14 13:41 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 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 d12bdbe..4b2e1f0 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2027,7 +2027,9 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 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;
 }
 

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

* Re: [PATCH] mmc: omap_hsmmc: release correct resource
  2012-04-14 13:41 ` Russell King - ARM Linux
@ 2012-04-17  6:43   ` S, Venkatraman
  -1 siblings, 0 replies; 5+ messages in thread
From: S, Venkatraman @ 2012-04-17  6:43 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-omap, linux-arm-kernel, Chris Ball, linux-mmc Mailing List

On Sat, Apr 14, 2012 at 7:11 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> 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>
> ---
>  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 d12bdbe..4b2e1f0 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -2027,7 +2027,9 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
>  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;
>  }
>
> --

Thanks Russell. I'll send it to Chris to be queued for 3.4-fixes.
--
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] 5+ messages in thread

* [PATCH] mmc: omap_hsmmc: release correct resource
@ 2012-04-17  6:43   ` S, Venkatraman
  0 siblings, 0 replies; 5+ messages in thread
From: S, Venkatraman @ 2012-04-17  6:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Apr 14, 2012 at 7:11 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> 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>
> ---
> ?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 d12bdbe..4b2e1f0 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -2027,7 +2027,9 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
> ?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;
> ?}
>
> --

Thanks Russell. I'll send it to Chris to be queued for 3.4-fixes.

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

* [PATCH] mmc: omap_hsmmc: release correct resource
  2012-04-18  9:49 [PATCH 1/3] " Venkatraman S
@ 2012-04-18 10:27 ` Venkatraman S
  0 siblings, 0 replies; 5+ messages in thread
From: Venkatraman S @ 2012-04-18 10:27 UTC (permalink / raw)
  To: cjb; +Cc: linux-mmc, linux-omap, Russell King, Venkatraman S

From: Russell King <rmk+kernel@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] 5+ messages in thread

end of thread, other threads:[~2012-04-18 10:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-14 13:41 [PATCH] mmc: omap_hsmmc: release correct resource Russell King - ARM Linux
2012-04-14 13:41 ` Russell King - ARM Linux
2012-04-17  6:43 ` S, Venkatraman
2012-04-17  6:43   ` S, Venkatraman
2012-04-18  9:49 [PATCH 1/3] " Venkatraman S
2012-04-18 10:27 ` [PATCH] " Venkatraman S

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.