ASoC: cs42l42: free_irq() before powering-down on probe() fail
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Tue, 26 Oct 2021 12:57:22 +0000 (13:57 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 26 Oct 2021 13:31:10 +0000 (14:31 +0100)
commita10148a8cf561d728c0f57994330b2da1df35577
tree0f409db68d265014944e9074ce7313dcc20fa40d
parent6cb725b8a5cc7b9106d5d6dd5d2ca78c76913775
ASoC: cs42l42: free_irq() before powering-down on probe() fail

Relying on devm to free the irq handler on probe failure leaves a
small window of opportunity for an interrupt to become pending and
then the handler to run after the chip has been reset and powered
off.

For safety cs42l42_probe() should free the irq in the error path.
As the irq is now disabled by the driver in probe() and remove()
there is no point allocating it as a devres-managed item, so
convert to plain non-devres.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211026125722.10220-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l42.c