aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/cdev.c')
-rw-r--r--drivers/mtd/ubi/cdev.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 03c759b4eeb5..b30a0b83d7f1 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -104,12 +104,9 @@ static int vol_cdev_open(struct inode *inode, struct file *file)
104 struct ubi_volume_desc *desc; 104 struct ubi_volume_desc *desc;
105 int vol_id = iminor(inode) - 1, mode, ubi_num; 105 int vol_id = iminor(inode) - 1, mode, ubi_num;
106 106
107 lock_kernel();
108 ubi_num = ubi_major2num(imajor(inode)); 107 ubi_num = ubi_major2num(imajor(inode));
109 if (ubi_num < 0) { 108 if (ubi_num < 0)
110 unlock_kernel();
111 return ubi_num; 109 return ubi_num;
112 }
113 110
114 if (file->f_mode & FMODE_WRITE) 111 if (file->f_mode & FMODE_WRITE)
115 mode = UBI_READWRITE; 112 mode = UBI_READWRITE;
@@ -119,7 +116,6 @@ static int vol_cdev_open(struct inode *inode, struct file *file)
119 dbg_gen("open volume %d, mode %d", vol_id, mode); 116 dbg_gen("open volume %d, mode %d", vol_id, mode);
120 117
121 desc = ubi_open_volume(ubi_num, vol_id, mode); 118 desc = ubi_open_volume(ubi_num, vol_id, mode);
122 unlock_kernel();
123 if (IS_ERR(desc)) 119 if (IS_ERR(desc))
124 return PTR_ERR(desc); 120 return PTR_ERR(desc);
125 121