Commit bbba85fa authored by Zheng Liang's avatar Zheng Liang Committed by Ulf Hansson
Browse files

mmc: mediatek: fix mem leak in msdc_drv_probe



It should use mmc_free_host to free mem in error patch of
msdc_drv_probe.

Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZheng Liang <zhengliang6@huawei.com>
Reviewed-by: default avatarChaotian Jing <chaotian.jing@mediatek.com>
Link: https://lore.kernel.org/r/20201112092530.32446-1-zhengliang6@huawei.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent ab07a135
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2504,8 +2504,10 @@ static int msdc_drv_probe(struct platform_device *pdev)

	host->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
								"hrst");
	if (IS_ERR(host->reset))
		return PTR_ERR(host->reset);
	if (IS_ERR(host->reset)) {
		ret = PTR_ERR(host->reset);
		goto host_free;
	}

	host->irq = platform_get_irq(pdev, 0);
	if (host->irq < 0) {