Skip to contentSkip to conversation

mips: cm: add missing iounmap() on error in mips_cm_probe()

PATCH Applied Qinglang Miao 2 participants 2 messages Oct 29, 2020 – Nov 6, 2020 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips: cm: add missing iounmap() on error in mips_cm_probe()

Add the missing iounmap() of iounmap(mips_gcr_base) before return from mips_cm_probe() in the error handling case.

---
 arch/mips/kernel/mips-cm.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/kernel/mips-cm.c +1 -0
index f60af512c..90f1c3df1 100644
@@ -266,6 +266,7 @@ int mips_cm_probe(void)
 	if ((base_reg & CM_GCR_BASE_GCRBASE) != addr) {
 		pr_err("GCRs appear to have been moved (expected them at 0x%08lx)!\n",
 		       (unsigned long)addr);
+		iounmap(mips_gcr_base);
 		mips_gcr_base = NULL;
 		return -ENODEV;
 	}
Signature · 1 line
2.23.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Qinglang Miao

Add the missing iounmap() of iounmap(mips_gcr_base) before return from mips_cm_probe() in the error handling case.

---
 arch/mips/kernel/mips-cm.c | 1 +
 1 file changed, 1 insertion(+)

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]