lkml.org 
[lkml]   [2003]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] release_region in RocketPort char driver
	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
--- 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;
}
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.064 / U:1.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site