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

Commit 7df56bbb authored by Ian Molton's avatar Ian Molton Committed by Ulf Hansson
Browse files

mmc: TMIO: Fix I/O mapping leak on error using devm_ioremap()



Signed-off-by: default avatarIan Molton <ian.molton@codethink.co.uk>
[bwh: Forward-ported to 4.0]
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 25db67e2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1108,7 +1108,8 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
	if (ret < 0)
		goto host_free;

	_host->ctl = ioremap(res_ctl->start, resource_size(res_ctl));
	_host->ctl = devm_ioremap(&pdev->dev,
				  res_ctl->start, resource_size(res_ctl));
	if (!_host->ctl) {
		ret = -ENOMEM;
		goto host_free;
@@ -1230,8 +1231,6 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)

	pm_runtime_put_sync(&pdev->dev);
	pm_runtime_disable(&pdev->dev);

	iounmap(host->ctl);
}
EXPORT_SYMBOL(tmio_mmc_host_remove);