]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] oops from console subsystem: dereferencing wild pointer
authorPetr Vandrovec <vandrove@vc.cvut.cz>
Fri, 16 Aug 2002 08:55:26 +0000 (01:55 -0700)
committerPetr Vandrovec <vandrove@vc.cvut.cz>
Fri, 16 Aug 2002 08:55:26 +0000 (01:55 -0700)
Make sure that the VC tty pointer is cleared when the tty is free'd.

drivers/char/console.c

index 193b580be7767c814a99dbbcded733a1d2562898..8be011adf7b3b7e3727ca7cc4af8872349d9d60d 100644 (file)
@@ -2395,10 +2395,15 @@ static int con_open(struct tty_struct *tty, struct file * filp)
 
 static void con_close(struct tty_struct *tty, struct file * filp)
 {
+       struct vt_struct *vt;
+       
        if (!tty)
                return;
        if (tty->count != 1) return;
        vcs_make_devfs (minor(tty->device) - tty->driver.minor_start, 1);
+       vt = (struct vt_struct*)tty->driver_data;
+       if (vt)
+               vc_cons[vt->vc_num].d->vc_tty = NULL;
        tty->driver_data = 0;
 }