]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/mmc/card/block.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[linux-2.6.git] / drivers / mmc / card / block.c
index 43d9a5b53e8d3a9d9bb7dcfee6ac95626749844f..ebc8b9d77613132f290b7372196ab50bfe416144 100644 (file)
@@ -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;