diff --git a/[refs] b/[refs] index 3ad343aa3aa5..c470842c0b78 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ef51c97623b94f51e439ac91d2736aab3d1b6594 +refs/heads/master: ca509f69dec7fa564005aa7e9fcf0cd46de3f7d6 diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index 5d405a1bfbe3..7710a6a77d97 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -3770,7 +3770,9 @@ int tty_register_driver(struct tty_driver *driver) if (!driver->put_char) driver->put_char = tty_default_put_char; + mutex_lock(&tty_mutex); list_add(&driver->tty_drivers, &tty_drivers); + mutex_unlock(&tty_mutex); if ( !(driver->flags & TTY_DRIVER_DYNAMIC_DEV) ) { for(i = 0; i < driver->num; i++) @@ -3796,8 +3798,9 @@ int tty_unregister_driver(struct tty_driver *driver) unregister_chrdev_region(MKDEV(driver->major, driver->minor_start), driver->num); - + mutex_lock(&tty_mutex); list_del(&driver->tty_drivers); + mutex_unlock(&tty_mutex); /* * Free the termios and termios_locked structures because diff --git a/trunk/fs/proc/proc_tty.c b/trunk/fs/proc/proc_tty.c index c1bbfbeb035e..b3a473b0a191 100644 --- a/trunk/fs/proc/proc_tty.c +++ b/trunk/fs/proc/proc_tty.c @@ -108,6 +108,8 @@ static void *t_start(struct seq_file *m, loff_t *pos) { struct list_head *p; loff_t l = *pos; + + mutex_lock(&tty_mutex); list_for_each(p, &tty_drivers) if (!l--) return list_entry(p, struct tty_driver, tty_drivers); @@ -124,6 +126,7 @@ static void *t_next(struct seq_file *m, void *v, loff_t *pos) static void t_stop(struct seq_file *m, void *v) { + mutex_unlock(&tty_mutex); } static struct seq_operations tty_drivers_op = {