From: Namjae Jeon <[email protected]>

when user does
cat /sys/block/mmcblk0boot0/ro_lock_until_next_power_on

power_ro_lock_show increments md->usage by calling mmc_blk_get
but it forgets to call mmc_blk_put to restore md->usage

Signed-off-by: Namjae Jeon <[email protected]>
Signed-off-by: Vivek Trivedi <[email protected]>
---
 drivers/mmc/card/block.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e12a03c..ae8e1de 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -201,6 +201,7 @@ static ssize_t power_ro_lock_show(struct device *dev,
                locked = 1;
 
        ret = snprintf(buf, PAGE_SIZE, "%d\n", locked);
+       mmc_blk_put(md);
 
        return ret;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to