From: Kenn H. <ke...@us...> - 2003-08-03 18:28:38
|
Update of /cvsroot/linux-vax/kernel-2.5/drivers/char In directory sc8-pr-cvs1:/tmp/cvs-serv25440/drivers/char Modified Files: tty_io.c Log Message: Merge with 2.5.59 Index: tty_io.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/char/tty_io.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- tty_io.c 16 Jul 2003 22:59:25 -0000 1.16 +++ tty_io.c 3 Aug 2003 18:28:35 -0000 1.17 @@ -833,6 +833,11 @@ * and locked termios may be retained.) */ + if (!try_module_get(driver->owner)) { + retval = -ENODEV; + goto end_init; + } + o_tty = NULL; tp = o_tp = NULL; ltp = o_ltp = NULL; @@ -991,6 +996,7 @@ free_tty_struct(tty); fail_no_mem: + module_put(driver->owner); retval = -ENOMEM; goto end_init; @@ -1033,6 +1039,7 @@ tty->magic = 0; (*tty->driver.refcount)--; list_del(&tty->tty_files); + module_put(tty->driver.owner); free_tty_struct(tty); } @@ -1836,6 +1843,8 @@ #else struct tty_struct *tty = arg; struct task_struct *p; + struct list_head *l; + struct pid *pid; int session; int i; struct file *filp; @@ -1848,9 +1857,8 @@ if (tty->driver.flush_buffer) tty->driver.flush_buffer(tty); read_lock(&tasklist_lock); - for_each_process(p) { - if ((p->tty == tty) || - ((session > 0) && (p->session == session))) { + for_each_task_pid(session, PIDTYPE_SID, p, l, pid) { + if (p->tty == tty || session > 0) { printk(KERN_NOTICE "SAK: killed process %d" " (%s): p->session==tty->session\n", p->pid, p->comm); |