aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/mtd_blkdevs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 475af42745cb..8c83b11a77d5 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -15,6 +15,7 @@
15#include <linux/blkdev.h> 15#include <linux/blkdev.h>
16#include <linux/blkpg.h> 16#include <linux/blkpg.h>
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/smp_lock.h>
18#include <linux/hdreg.h> 19#include <linux/hdreg.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/mutex.h> 21#include <linux/mutex.h>
@@ -237,6 +238,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
237 if (!dev) 238 if (!dev)
238 return ret; 239 return ret;
239 240
241 lock_kernel();
240 mutex_lock(&dev->lock); 242 mutex_lock(&dev->lock);
241 243
242 if (!dev->mtd) 244 if (!dev->mtd)
@@ -250,6 +252,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
250 } 252 }
251unlock: 253unlock:
252 mutex_unlock(&dev->lock); 254 mutex_unlock(&dev->lock);
255 unlock_kernel();
253 blktrans_dev_put(dev); 256 blktrans_dev_put(dev);
254 return ret; 257 return ret;
255} 258}
@@ -258,7 +261,7 @@ static const struct block_device_operations mtd_blktrans_ops = {
258 .owner = THIS_MODULE, 261 .owner = THIS_MODULE,
259 .open = blktrans_open, 262 .open = blktrans_open,
260 .release = blktrans_release, 263 .release = blktrans_release,
261 .locked_ioctl = blktrans_ioctl, 264 .ioctl = blktrans_ioctl,
262 .getgeo = blktrans_getgeo, 265 .getgeo = blktrans_getgeo,
263}; 266};
264 267