Skip to contentSkip to conversation

Balanced io{re|un}map : drivers/char/moxa.c

PATCH In review Christophe Lucas 2 participants 2 messages Jun 24, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Balanced io{re|un}map : drivers/char/moxa.c

description:
Balancing functions: io{re|un}map here.
Make sure calls to certain functions are matched by the relevant function at other end of the function, and also during ALL failure/early return paths.

drivers/char/moxa.c +4 -0
diff -urpN -X dontdiff 2.6.12-orig/drivers/char/moxa.c 2.6.12/drivers/char/moxa.c
@@ -492,6 +492,10 @@ static void __exit moxa_exit(void)
 	if (tty_unregister_driver(moxaDriver))
 		printk("Couldn't unregister MOXA Intellio family serial driver\n");
 	put_tty_driver(moxaDriver);
+	for (i = 0; i < numBoards; i++) {
+		iounmap((void __iomem *) moxaBaseAddr[i]);
+	}
+
 	if (verbose)
 		printk("Done\n");
 }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

drivers/char/moxa.c static void __exit moxa_exit(void) · line 496

Quoted 11 lines · Christophe Lucas

Make sure calls to certain functions are matched by the relevant function at other end of the function, and also during ALL failure/early return paths.

drivers/char/moxa.c +4 -0
@@ -492,6 +492,10 @@ static void __exit moxa_exit(void)
 
+	for (i = 0; i < numBoards; i++) {
+		iounmap((void __iomem *) moxaBaseAddr[i]);
+	}
+

No need for cast and for {}.

static void __iomem *moxaBaseAddr[MAX_BOARDS];

Oh, and it won't compile.
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors