aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLiu, Changcheng <changcheng.liu@intel.com>2017-12-16 23:15:45 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2017-12-18 14:02:16 +0100
commit0be55579a127916ebe39db2a74d906a2dfceed42 (patch)
treee918c0303fb9ca986336ba880f8ea20c2208c74f /drivers/mmc
parentMerge branch 'fixes' into next (diff)
downloadlinux-dev-0be55579a127916ebe39db2a74d906a2dfceed42.tar.xz
linux-dev-0be55579a127916ebe39db2a74d906a2dfceed42.zip
mmc: block: fix logical error to avoid memory leak
If the MMC_DRV_OP_GET_EXT_CSD request completes successfully, then ext_csd must be freed, but in one case it was not. Fix that. Signed-off-by: Liu Changcheng <changcheng.liu@intel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/block.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 654fc1ebd675..20135a5de748 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2795,6 +2795,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)
if (n != EXT_CSD_STR_LEN) {
err = -EINVAL;
+ kfree(ext_csd);
goto out_free;
}