aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 841f0bd3eaaf..f07637a8f88f 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2723,7 +2723,11 @@ static void __do_SAK(void *arg)
2723 } 2723 }
2724 task_lock(p); 2724 task_lock(p);
2725 if (p->files) { 2725 if (p->files) {
2726 rcu_read_lock(); 2726 /*
2727 * We don't take a ref to the file, so we must
2728 * hold ->file_lock instead.
2729 */
2730 spin_lock(&p->files->file_lock);
2727 fdt = files_fdtable(p->files); 2731 fdt = files_fdtable(p->files);
2728 for (i=0; i < fdt->max_fds; i++) { 2732 for (i=0; i < fdt->max_fds; i++) {
2729 filp = fcheck_files(p->files, i); 2733 filp = fcheck_files(p->files, i);
@@ -2738,7 +2742,7 @@ static void __do_SAK(void *arg)
2738 break; 2742 break;
2739 } 2743 }
2740 } 2744 }
2741 rcu_read_unlock(); 2745 spin_unlock(&p->files->file_lock);
2742 } 2746 }
2743 task_unlock(p); 2747 task_unlock(p);
2744 } while_each_thread(g, p); 2748 } while_each_thread(g, p);