summaryrefslogtreecommitdiff
path: root/drivers/char/selection.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/selection.c')
-rw-r--r--drivers/char/selection.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index f97b9e8..6e79340 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -26,6 +26,7 @@
#include <linux/selection.h>
#include <linux/tiocl.h>
#include <linux/console.h>
+#include <linux/smp_lock.h>
/* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */
#define isspace(c) ((c) == ' ')
@@ -312,6 +313,8 @@ int paste_selection(struct tty_struct *tty)
struct tty_ldisc *ld;
DECLARE_WAITQUEUE(wait, current);
+ lock_kernel();
+
acquire_console_sem();
poke_blanked_console();
release_console_sem();
@@ -335,5 +338,6 @@ int paste_selection(struct tty_struct *tty)
__set_current_state(TASK_RUNNING);
tty_ldisc_deref(ld);
+ unlock_kernel();
return 0;
}