Commit ca364896 authored by Andrew Morton's avatar Andrew Morton Committed by Dave Jones

[PATCH] file->f_list locking in tty_io.c

release_mem() is altering the file->f_list lists without taking the
appropriate spinlock.
parent cc6c76b9
...@@ -1034,7 +1034,9 @@ static void release_mem(struct tty_struct *tty, int idx) ...@@ -1034,7 +1034,9 @@ static void release_mem(struct tty_struct *tty, int idx)
} }
o_tty->magic = 0; o_tty->magic = 0;
(*o_tty->driver.refcount)--; (*o_tty->driver.refcount)--;
file_list_lock();
list_del(&o_tty->tty_files); list_del(&o_tty->tty_files);
file_list_unlock();
free_tty_struct(o_tty); free_tty_struct(o_tty);
} }
...@@ -1046,7 +1048,9 @@ static void release_mem(struct tty_struct *tty, int idx) ...@@ -1046,7 +1048,9 @@ static void release_mem(struct tty_struct *tty, int idx)
} }
tty->magic = 0; tty->magic = 0;
(*tty->driver.refcount)--; (*tty->driver.refcount)--;
file_list_lock();
list_del(&tty->tty_files); list_del(&tty->tty_files);
file_list_unlock();
module_put(tty->driver.owner); module_put(tty->driver.owner);
free_tty_struct(tty); free_tty_struct(tty);
} }
......
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