ASoC: samsung: Fix possible double iounmap on s3c24xx driver probe failure
authorKrzysztof Kozlowski <krzk@kernel.org>
Thu, 27 Jul 2017 17:13:36 +0000 (19:13 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 28 Jul 2017 09:58:23 +0000 (10:58 +0100)
commit776bac64bf13e20c27f7ad168811abdf3b72f14d
tree9e5802d8a1976e8d4ca635cac866c3b06be64e05
parent0f11daf10b4ac6a6c8ea6b39552f119c595b5406
ASoC: samsung: Fix possible double iounmap on s3c24xx driver probe failure

Commit 87b132bc0315 ("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: 87b132bc0315 ("ASoC: samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Arvind Yadav<arvind.yadav.cs@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/s3c-i2s-v2.c