Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79a49fcc authored by Liu, Changcheng's avatar Liu, Changcheng Committed by Greg Kroah-Hartman
Browse files

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: default avatarLiu Changcheng <changcheng.liu@intel.com>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9dd93e52
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}