* [PATCH] release_region in RocketPort char driver
@ 2003-10-06 14:05 Felipe W Damasio
2003-10-13 0:31 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Felipe W Damasio @ 2003-10-06 14:05 UTC (permalink / raw)
To: support; +Cc: Andrew Morton, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 192 bytes --]
Hi Andrew/Comtrol people :),
Patch against 2.6.0-test6.
- Release a previous requested region if tty_register_driver fails.
Found by smatch
Please consider applying,
Thanks.
Felipe
[-- Attachment #2: rocket-release_region.patch --]
[-- Type: text/plain, Size: 380 bytes --]
--- linux-2.6.0-test6/drivers/char/rocket.c.orig 2003-10-06 10:57:29.000000000 -0300
+++ linux-2.6.0-test6/drivers/char/rocket.c 2003-10-06 11:00:29.000000000 -0300
@@ -2468,6 +2468,7 @@
if (retval < 0) {
printk(KERN_INFO "Couldn't install tty RocketPort driver (error %d)\n", -retval);
put_tty_driver(rocket_driver);
+ release_region(controller, 4);
return -1;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] release_region in RocketPort char driver
2003-10-06 14:05 [PATCH] release_region in RocketPort char driver Felipe W Damasio
@ 2003-10-13 0:31 ` Andrew Morton
2003-10-14 13:44 ` Felipe W Damasio
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2003-10-13 0:31 UTC (permalink / raw)
To: Felipe W Damasio; +Cc: support, linux-kernel
Felipe W Damasio <felipewd@terra.com.br> wrote:
>
> --- linux-2.6.0-test6/drivers/char/rocket.c.orig 2003-10-06 10:57:29.000000000 -0300
> +++ linux-2.6.0-test6/drivers/char/rocket.c 2003-10-06 11:00:29.000000000 -0300
> @@ -2468,6 +2468,7 @@
> if (retval < 0) {
> printk(KERN_INFO "Couldn't install tty RocketPort driver (error %d)\n", -retval);
> put_tty_driver(rocket_driver);
> + release_region(controller, 4);
> return -1;
> }
a) If variable `controller' is zero then we never allocated this region,
so we should not free it.
b) There is an error exit path further on which also needs to release
this region (if controller != 0).
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] release_region in RocketPort char driver
2003-10-13 0:31 ` Andrew Morton
@ 2003-10-14 13:44 ` Felipe W Damasio
0 siblings, 0 replies; 3+ messages in thread
From: Felipe W Damasio @ 2003-10-14 13:44 UTC (permalink / raw)
To: Andrew Morton; +Cc: support, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
Hi Andrew,
Andrew Morton wrote:
> Felipe W Damasio <felipewd@terra.com.br> wrote:
> a) If variable `controller' is zero then we never allocated this region,
> so we should not free it.
>
> b) There is an error exit path further on which also needs to release
> this region (if controller != 0).
Right.
Please review this patch, then.
Against 2.6.0-test7.
Thanks,
Felipe
[-- Attachment #2: rocket-release_region.patch --]
[-- Type: text/plain, Size: 612 bytes --]
--- linux-2.6.0-test7/drivers/char/rocket.c.orig 2003-10-14 11:38:44.000000000 -0200
+++ linux-2.6.0-test7/drivers/char/rocket.c 2003-10-14 11:42:40.000000000 -0200
@@ -2466,6 +2466,8 @@
if (retval < 0) {
printk(KERN_INFO "Couldn't install tty RocketPort driver (error %d)\n", -retval);
put_tty_driver(rocket_driver);
+ if (controller)
+ release_region (controller, 4);
return -1;
}
@@ -2497,6 +2499,8 @@
del_timer_sync(&rocket_timer);
tty_unregister_driver(rocket_driver);
put_tty_driver(rocket_driver);
+ if (controller)
+ release_region (controller, 4);
return -ENXIO;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-10-14 14:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-06 14:05 [PATCH] release_region in RocketPort char driver Felipe W Damasio
2003-10-13 0:31 ` Andrew Morton
2003-10-14 13:44 ` Felipe W Damasio
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.