aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vc_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/vc_screen.c')
-rw-r--r--drivers/char/vc_screen.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index 83aeedda200c..eebfad2777d2 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -34,6 +34,7 @@
34#include <linux/kbd_kern.h> 34#include <linux/kbd_kern.h>
35#include <linux/console.h> 35#include <linux/console.h>
36#include <linux/device.h> 36#include <linux/device.h>
37#include <linux/smp_lock.h>
37 38
38#include <asm/uaccess.h> 39#include <asm/uaccess.h>
39#include <asm/byteorder.h> 40#include <asm/byteorder.h>
@@ -460,9 +461,13 @@ static int
460vcs_open(struct inode *inode, struct file *filp) 461vcs_open(struct inode *inode, struct file *filp)
461{ 462{
462 unsigned int currcons = iminor(inode) & 127; 463 unsigned int currcons = iminor(inode) & 127;
464 int ret = 0;
465
466 lock_kernel();
463 if(currcons && !vc_cons_allocated(currcons-1)) 467 if(currcons && !vc_cons_allocated(currcons-1))
464 return -ENXIO; 468 ret = -ENXIO;
465 return 0; 469 unlock_kernel();
470 return ret;
466} 471}
467 472
468static const struct file_operations vcs_fops = { 473static const struct file_operations vcs_fops = {