Re: [PATCH] release_region in RocketPort char driver

From: Andrew Morton
Date: Sun Oct 12 2003 - 19:28:49 EST


Felipe W Damasio <felipewd@xxxxxxxxxxxx> 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).


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/