aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/char/fs3270.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index 097d3846a828..d449063c30fe 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -38,6 +38,8 @@ struct fs3270 {
38 size_t rdbuf_size; /* size of data returned by RDBUF */ 38 size_t rdbuf_size; /* size of data returned by RDBUF */
39}; 39};
40 40
41static DEFINE_MUTEX(fs3270_mutex);
42
41static void 43static void
42fs3270_wake_up(struct raw3270_request *rq, void *data) 44fs3270_wake_up(struct raw3270_request *rq, void *data)
43{ 45{
@@ -328,7 +330,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
328 if (!fp) 330 if (!fp)
329 return -ENODEV; 331 return -ENODEV;
330 rc = 0; 332 rc = 0;
331 lock_kernel(); 333 mutex_lock(&fs3270_mutex);
332 switch (cmd) { 334 switch (cmd) {
333 case TUBICMD: 335 case TUBICMD:
334 fp->read_command = arg; 336 fp->read_command = arg;
@@ -354,7 +356,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
354 rc = -EFAULT; 356 rc = -EFAULT;
355 break; 357 break;
356 } 358 }
357 unlock_kernel(); 359 mutex_unlock(&fs3270_mutex);
358 return rc; 360 return rc;
359} 361}
360 362
@@ -437,7 +439,7 @@ fs3270_open(struct inode *inode, struct file *filp)
437 minor = tty->index + RAW3270_FIRSTMINOR; 439 minor = tty->index + RAW3270_FIRSTMINOR;
438 tty_kref_put(tty); 440 tty_kref_put(tty);
439 } 441 }
440 lock_kernel(); 442 mutex_lock(&fs3270_mutex);
441 /* Check if some other program is already using fullscreen mode. */ 443 /* Check if some other program is already using fullscreen mode. */
442 fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor); 444 fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor);
443 if (!IS_ERR(fp)) { 445 if (!IS_ERR(fp)) {
@@ -478,7 +480,7 @@ fs3270_open(struct inode *inode, struct file *filp)
478 } 480 }
479 filp->private_data = fp; 481 filp->private_data = fp;
480out: 482out:
481 unlock_kernel(); 483 mutex_unlock(&fs3270_mutex);
482 return rc; 484 return rc;
483} 485}
484 486