diff mbox

[1/2] devres: Fix double mem region release in devm_ioremap_resource()

Message ID 20180119180408.GB31540@lenoch (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Ladislav Michl Jan. 19, 2018, 6:04 p.m. UTC
devm_release_mem_region() is called explicitely in case
devm_ioremap() fails, however the same release function
is later called also as devres release of
devm_request_mem_region() causing double resource free.

Fixes: 72f8c0bfa0de ("lib: devres: add convenience function to remap a resource")
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 lib/devres.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox

Patch

diff --git a/lib/devres.c b/lib/devres.c
index 5f2aedd58bc5..584356a568d0 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -156,7 +156,6 @@  void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
 	dest_ptr = devm_ioremap(dev, res->start, size);
 	if (!dest_ptr) {
 		dev_err(dev, "ioremap failed for resource %pR\n", res);
-		devm_release_mem_region(dev, res->start, size);
 		dest_ptr = IOMEM_ERR_PTR(-ENOMEM);
 	}