diff options
author | Liu, Changcheng <changcheng.liu@intel.com> | 2017-12-16 18:15:45 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-24 13:01:24 +0300 |
commit | 79a49fcc076882ea99ca52edb0a1569f1780a37c (patch) | |
tree | 6c1de7b3f29cd20ef19120628c108cc86606160c /drivers/mmc/core | |
parent | 9dd93e524955488300b8604ea3916881cee80977 (diff) | |
download | linux-79a49fcc076882ea99ca52edb0a1569f1780a37c.tar.xz |
mmc: block: fix logical error to avoid memory leak
[ Upstream commit 0be55579a127916ebe39db2a74d906a2dfceed42 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/block.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index ccb516f18d72..9c6f2ce3b710 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2387,6 +2387,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; } |