diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 8c83b11a77d5..5ca80aee2ed0 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -165,8 +165,9 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) | |||
165 | int ret; | 165 | int ret; |
166 | 166 | ||
167 | if (!dev) | 167 | if (!dev) |
168 | return -ERESTARTSYS; | 168 | return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/ |
169 | 169 | ||
170 | lock_kernel(); | ||
170 | mutex_lock(&dev->lock); | 171 | mutex_lock(&dev->lock); |
171 | 172 | ||
172 | if (!dev->mtd) { | 173 | if (!dev->mtd) { |
@@ -183,6 +184,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) | |||
183 | unlock: | 184 | unlock: |
184 | mutex_unlock(&dev->lock); | 185 | mutex_unlock(&dev->lock); |
185 | blktrans_dev_put(dev); | 186 | blktrans_dev_put(dev); |
187 | unlock_kernel(); | ||
186 | return ret; | 188 | return ret; |
187 | } | 189 | } |
188 | 190 | ||
@@ -194,6 +196,7 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode) | |||
194 | if (!dev) | 196 | if (!dev) |
195 | return ret; | 197 | return ret; |
196 | 198 | ||
199 | lock_kernel(); | ||
197 | mutex_lock(&dev->lock); | 200 | mutex_lock(&dev->lock); |
198 | 201 | ||
199 | /* Release one reference, we sure its not the last one here*/ | 202 | /* Release one reference, we sure its not the last one here*/ |
@@ -206,6 +209,7 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode) | |||
206 | unlock: | 209 | unlock: |
207 | mutex_unlock(&dev->lock); | 210 | mutex_unlock(&dev->lock); |
208 | blktrans_dev_put(dev); | 211 | blktrans_dev_put(dev); |
212 | unlock_kernel(); | ||
209 | return ret; | 213 | return ret; |
210 | } | 214 | } |
211 | 215 | ||