Messages in this thread Patch in this message | | | Date | Tue, 14 Oct 2003 11:44:09 -0200 | From | Felipe W Damasio <> | Subject | Re: [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; } | |