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

Commit 776bac64 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown
Browse files

ASoC: samsung: Fix possible double iounmap on s3c24xx driver probe failure



Commit 87b132bc ("ASoC: samsung: s3c24{xx,12}-i2s: port to use
generic dmaengine API") moved ioremap() call from
s3c-i2s-v2.c:s3c_i2sv2_probe() to s3c2412-i2s.c:s3c2412_iis_dev_probe()
and converted it to devm- resource managed interface.

However the error path in first of them - s3c_i2sv2_probe() - was not
updated.  If getting a iis clock in s3c_i2sv2_probe() failed, the
address space would be unmapped there.  This could lead to:
1. double iounmap() later from devm-interface of s3c2412_iis_dev_probe()),
2. accessing the memory by other functions in s3c2412-i2s.c unit.

Anyway, the owner of this mapped region should be s3c2412-i2s.c because
it starts the mapping.

Affected are drivers for S3C24xx family although issue was not reproduced.

Fixes: 87b132bc ("ASoC: samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API")
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarArvind <Yadav&lt;arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0f11daf1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -634,7 +634,6 @@ int s3c_i2sv2_probe(struct snd_soc_dai *dai,
	i2s->iis_pclk = clk_get(dev, "iis");
	if (IS_ERR(i2s->iis_pclk)) {
		dev_err(dev, "failed to get iis_clock\n");
		iounmap(i2s->regs);
		return -ENOENT;
	}