summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/block.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-09 22:31:58 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-09 22:31:58 +0200
commit9e165acf1b9e37af7c0fa39399b43d0bd8600039 (patch)
tree7ffdb0ad4c35ac9c19c4096b4f22ccc9b1eeefad /drivers/mmc/card/block.c
parentMerge branch 'ptebits' into devel (diff)
parent[ARM] 5267/1: [AT91] Name conflict in mach-at91/leds.c (diff)
downloadlinux-9e165acf1b9e37af7c0fa39399b43d0bd8600039.tar.xz
linux-9e165acf1b9e37af7c0fa39399b43d0bd8600039.zip
Merge branch 'at91' into devel
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r--drivers/mmc/card/block.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 86dbb366415a..6986f3926244 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -103,8 +103,10 @@ static int mmc_blk_open(struct inode *inode, struct file *filp)
check_disk_change(inode->i_bdev);
ret = 0;
- if ((filp->f_mode & FMODE_WRITE) && md->read_only)
+ if ((filp->f_mode & FMODE_WRITE) && md->read_only) {
+ mmc_blk_put(md);
ret = -EROFS;
+ }
}
return ret;