diff mbox

mmc: fix refcount leak in power_ro_lock_show

Message ID 1367107609-2586-1-git-send-email-linkinjeon@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Namjae Jeon April 28, 2013, 12:06 a.m. UTC
From: Namjae Jeon <namjae.jeon@samsung.com>

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 <namjae.jeon@samsung.com>
Signed-off-by: Vivek Trivedi <t.vivek@samsung.com>
---
 drivers/mmc/card/block.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

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;
 }