Skip to content

Commit 2d863e9

Browse files
author
Jonathan Corbet
committed
viotape: cdev lock_kernel pushdown ()
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 309c455 commit 2d863e9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/char/viotape.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <linux/completion.h>
4747
#include <linux/proc_fs.h>
4848
#include <linux/seq_file.h>
49+
#include <linux/smp_lock.h>
4950

5051
#include <asm/uaccess.h>
5152
#include <asm/ioctls.h>
@@ -687,6 +688,7 @@ static int viotap_open(struct inode *inode, struct file *file)
687688
if (op == NULL)
688689
return -ENOMEM;
689690

691+
lock_kernel()
690692
get_dev_info(file->f_path.dentry->d_inode, &devi);
691693

692694
/* Note: We currently only support one mode! */
@@ -717,6 +719,7 @@ static int viotap_open(struct inode *inode, struct file *file)
717719

718720
free_op:
719721
free_op_struct(op);
722+
unlock_kernel();
720723
return ret;
721724
}
722725

0 commit comments

Comments
 (0)