[PATCH] mmc: omap: Fix error introduced by fix to release_mem_region() path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 31ee9181eb92: (mmc: omap: Fix DMA configuration to not rely
on device id) fixed getting of the DMA resources when booted with
device tree. This patch however changed the handling of the
free_mem_region() error path by reusing the struct resource *res
for the DMA resources.

Fix the error the same way omap_hsmmc.c driver handles it, which
is to restore the resource before using the values to call
release_mem_region().

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>

---

Chris, looks like the patch introducing this error is queued in
arm-soc fixes branch.. Care to ack this one too and I'll merge it
via arm-soc as well?

After that, no need for me to patch this driver for my mach-omap2
device tree conversion I hope :)

--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1465,7 +1465,10 @@ err_free_mmc_host:
 err_ioremap:
 	kfree(host);
 err_free_mem_region:
-	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;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux