aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r--drivers/mmc/card/block.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index cb9fbc83b090..8433cde29c8b 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -29,6 +29,7 @@
29#include <linux/kdev_t.h> 29#include <linux/kdev_t.h>
30#include <linux/blkdev.h> 30#include <linux/blkdev.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/smp_lock.h>
32#include <linux/scatterlist.h> 33#include <linux/scatterlist.h>
33#include <linux/string_helpers.h> 34#include <linux/string_helpers.h>
34 35
@@ -107,6 +108,7 @@ static int mmc_blk_open(struct block_device *bdev, fmode_t mode)
107 struct mmc_blk_data *md = mmc_blk_get(bdev->bd_disk); 108 struct mmc_blk_data *md = mmc_blk_get(bdev->bd_disk);
108 int ret = -ENXIO; 109 int ret = -ENXIO;
109 110
111 lock_kernel();
110 if (md) { 112 if (md) {
111 if (md->usage == 2) 113 if (md->usage == 2)
112 check_disk_change(bdev); 114 check_disk_change(bdev);
@@ -117,6 +119,7 @@ static int mmc_blk_open(struct block_device *bdev, fmode_t mode)
117 ret = -EROFS; 119 ret = -EROFS;
118 } 120 }
119 } 121 }
122 unlock_kernel();
120 123
121 return ret; 124 return ret;
122} 125}
@@ -125,7 +128,9 @@ static int mmc_blk_release(struct gendisk *disk, fmode_t mode)
125{ 128{
126 struct mmc_blk_data *md = disk->private_data; 129 struct mmc_blk_data *md = disk->private_data;
127 130
131 lock_kernel();
128 mmc_blk_put(md); 132 mmc_blk_put(md);
133 unlock_kernel();
129 return 0; 134 return 0;
130} 135}
131 136