2003-06-08 13:06:07

by Hu Gang

[permalink] [raw]
Subject: fix oops in driver/serial/core.c

Hell all:

Fix bug in 2.5.70.

--- linux-2.5.70/drivers/serial/core.c.old Sun Jun 8 21:11:49 2003
+++ linux-2.5.70/drivers/serial/core.c Sun Jun 8 21:12:06 2003
@@ -2189,11 +2189,11 @@
void uart_unregister_driver(struct uart_driver *drv)
{
struct tty_driver *p = drv->tty_driver;
- drv->tty_driver = NULL;
tty_unregister_driver(p);
kfree(drv->state);
kfree(drv->tty_driver->termios);
kfree(drv->tty_driver);
+ drv->tty_driver = NULL;
}

struct tty_driver *uart_console_device(struct console *co, int *index)


--
Hu Gang / Steve
Email : [email protected], [email protected]
GPG FinePrint: 4099 3F1D AE01 1817 68F7 D499 A6C2 C418 86C8 610E
http://soulinfo.com/~hugang/HuGang.asc
ICQ# : 205800361
Registered Linux User : 204016


2003-06-09 06:05:17

by Milton Miller

[permalink] [raw]
Subject: Re: [PATCH] fix oops in driver/serial/core.c

How about the following patch instead, which preserves the reordering
done by Al Viro?

===== drivers/serial/core.c 1.62 vs edited =====
--- 1.62/drivers/serial/core.c Fri Jun 6 01:36:47 2003
+++ edited/drivers/serial/core.c Sun Jun 8 20:59:44 2003
@@ -2192,8 +2192,8 @@
drv->tty_driver = NULL;
tty_unregister_driver(p);
kfree(drv->state);
- kfree(drv->tty_driver->termios);
- kfree(drv->tty_driver);
+ kfree(p->termios);
+ kfree(p);
}

struct tty_driver *uart_console_device(struct console *co, int *index)