mmc: omap_hsmmc: release correct resource

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>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
Russell King 2012-04-18 11:11:57 +01:00 коммит произвёл Chris Ball
Родитель ca5879d3ff
Коммит 48b332f991
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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;
}