All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] Balanced io{re|un}map : drivers/char/moxa.c
@ 2005-06-24  8:52 Christophe Lucas
  2005-06-24 15:40 ` Alexey Dobriyan
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lucas @ 2005-06-24  8:52 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

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.

Signed-off-by: Christophe Lucas <clucas@rotomalug.org>

diff -urpN -X dontdiff 2.6.12-orig/drivers/char/moxa.c 2.6.12/drivers/char/moxa.c
--- 2.6.12-orig/drivers/char/moxa.c	2005-06-17 21:48:29.000000000 +0200
+++ 2.6.12/drivers/char/moxa.c	2005-06-24 09:52:40.321457432 +0200
@@ -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");
 }

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [KJ] [PATCH] Balanced io{re|un}map : drivers/char/moxa.c
  2005-06-24  8:52 [KJ] [PATCH] Balanced io{re|un}map : drivers/char/moxa.c Christophe Lucas
@ 2005-06-24 15:40 ` Alexey Dobriyan
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2005-06-24 15:40 UTC (permalink / raw)
  To: kernel-janitors

On Friday 24 June 2005 12:52, Christophe Lucas wrote:
> 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.

> --- 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)

> +	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
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-24 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-24  8:52 [KJ] [PATCH] Balanced io{re|un}map : drivers/char/moxa.c Christophe Lucas
2005-06-24 15:40 ` Alexey Dobriyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.