aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memstick/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/memstick/core')
-rw-r--r--drivers/memstick/core/mspro_block.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 56645408d225..eef78a068fd1 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -18,6 +18,7 @@
18#include <linux/kthread.h> 18#include <linux/kthread.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/smp_lock.h>
21#include <linux/memstick.h> 22#include <linux/memstick.h>
22 23
23#define DRIVER_NAME "mspro_block" 24#define DRIVER_NAME "mspro_block"
@@ -179,6 +180,7 @@ static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode)
179 struct mspro_block_data *msb = disk->private_data; 180 struct mspro_block_data *msb = disk->private_data;
180 int rc = -ENXIO; 181 int rc = -ENXIO;
181 182
183 lock_kernel();
182 mutex_lock(&mspro_block_disk_lock); 184 mutex_lock(&mspro_block_disk_lock);
183 185
184 if (msb && msb->card) { 186 if (msb && msb->card) {
@@ -190,6 +192,7 @@ static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode)
190 } 192 }
191 193
192 mutex_unlock(&mspro_block_disk_lock); 194 mutex_unlock(&mspro_block_disk_lock);
195 unlock_kernel();
193 196
194 return rc; 197 return rc;
195} 198}
@@ -221,7 +224,11 @@ static int mspro_block_disk_release(struct gendisk *disk)
221 224
222static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode) 225static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode)
223{ 226{
224 return mspro_block_disk_release(disk); 227 int ret;
228 lock_kernel();
229 ret = mspro_block_disk_release(disk);
230 unlock_kernel();
231 return ret;
225} 232}
226 233
227static int mspro_block_bd_getgeo(struct block_device *bdev, 234static int mspro_block_bd_getgeo(struct block_device *bdev,