aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/vt/vc_screen.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-26 20:30:17 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-03-26 20:30:17 -0400
commite8cd81693bbbb15db57d3c9aa7dd90eda4842874 (patch)
treef8ba631b03652f9e570fa1e8bd0395af63cf2bb3 /drivers/tty/vt/vc_screen.c
parent7ea600b5314529f9d1b9d6d3c41cb26fce6a7a4a (diff)
vt: synchronize_rcu() under spinlock is not nice...
vcs_poll_data_free() calls unregister_vt_notifier(), which calls atomic_notifier_chain_unregister(), which calls synchronize_rcu(). Do it *after* we'd dropped ->f_lock. Cc: stable@vger.kernel.org (all kernels since 2.6.37) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/tty/vt/vc_screen.c')
-rw-r--r--drivers/tty/vt/vc_screen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index e4ca345873c3..d7799deacb21 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -93,7 +93,7 @@ vcs_poll_data_free(struct vcs_poll_data *poll)
93static struct vcs_poll_data * 93static struct vcs_poll_data *
94vcs_poll_data_get(struct file *file) 94vcs_poll_data_get(struct file *file)
95{ 95{
96 struct vcs_poll_data *poll = file->private_data; 96 struct vcs_poll_data *poll = file->private_data, *kill = NULL;
97 97
98 if (poll) 98 if (poll)
99 return poll; 99 return poll;
@@ -122,10 +122,12 @@ vcs_poll_data_get(struct file *file)
122 file->private_data = poll; 122 file->private_data = poll;
123 } else { 123 } else {
124 /* someone else raced ahead of us */ 124 /* someone else raced ahead of us */
125 vcs_poll_data_free(poll); 125 kill = poll;
126 poll = file->private_data; 126 poll = file->private_data;
127 } 127 }
128 spin_unlock(&file->f_lock); 128 spin_unlock(&file->f_lock);
129 if (kill)
130 vcs_poll_data_free(kill);
129 131
130 return poll; 132 return poll;
131} 133}