Skip to contentSkip to conversation

MIPS: TXx9: Add missing iounmap

PATCH In review Vasyl Gomonovych 2 participants 2 messages Nov 23, 2017 – Mar 5, 2018 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: TXx9: Add missing iounmap

Add the missing iounmap() before put_device and
return from txx9_sramc_init().

---
 arch/mips/txx9/generic/setup.c | 2 ++
 1 file changed, 2 insertions(+)
arch/mips/txx9/generic/setup.c +2 -0
index 1791a44ee570..6ef5edb85d68 100644
@@ -965,6 +965,8 @@ void __init txx9_sramc_init(struct resource *r)
 	}
 	return;
 exit_put:
+	if (dev->base)
+		iounmap(dev->base);
 	put_device(&dev->dev);
 	return;
 }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 13 lines · Vasyl Gomonovych

Add the missing iounmap() before put_device and
return from txx9_sramc_init().

---
 arch/mips/txx9/generic/setup.c | 2 ++
 1 file changed, 2 insertions(+)
arch/mips/txx9/generic/setup.c +0 -0
index 1791a44ee570..6ef5edb85d68 100644

arch/mips/txx9/generic/setup.c void __init txx9_sramc_init(struct resource *r) · line 969

Quoted 5 lines
arch/mips/txx9/generic/setup.c +2 -0
@@ -965,6 +965,8 @@ void __init txx9_sramc_init(struct resource *r)
 	}
 	return;
 exit_put:
+	if (dev->base)
+		iounmap(dev->base);

I think if dev->base was NULL then a different error path would have been taken already.

More concerning to be honest though is the sysfs_create_bin_file() error handling just above here, which seems to iounmap() and kfree() *after* device_unregister(). txx9_device_release() already kfrees it.

The iounmap() call should prresumably move before the kfree() in txx9_device_release(), and the kfree() after device_unregister() should be removed?

Cheers
James

Quoted 6 lines
arch/mips/txx9/generic/setup.c +0 -0
 	put_device(&dev->dev);
 	return;
 }
Signature · 1 line
1.9.1