Commit f3619737 authored by Petr Vandrovec's avatar Petr Vandrovec

[PATCH] oops from console subsystem: dereferencing wild pointer

Make sure that the VC tty pointer is cleared when the tty is free'd.
parent b55c6d42
...@@ -2395,10 +2395,15 @@ static int con_open(struct tty_struct *tty, struct file * filp) ...@@ -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) static void con_close(struct tty_struct *tty, struct file * filp)
{ {
struct vt_struct *vt;
if (!tty) if (!tty)
return; return;
if (tty->count != 1) return; if (tty->count != 1) return;
vcs_make_devfs (minor(tty->device) - tty->driver.minor_start, 1); 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; tty->driver_data = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment