ASoC: Fix error handling in wm899x
Subsystems (3)
v2 cover ASoC: Fix error handling in wm899x
The first patch fixed a wrong free in wm8997_probe. The remaining three patches fixed PM disable depth imbalance on error handling.
Zhang Qilong (4):
ASoC: arizona: Fix a wrong free in wm8997_probe
ASoC: arizona: Fix PM disable depth imbalance on error
ASoC: wm8994: Fix PM disable depth imbalance on error
ASoC: wm8998: Fix PM disable depth imbalance on error
sound/soc/codecs/wm8994.c | 6 +++++- sound/soc/codecs/wm8997.c | 8 ++++++-- sound/soc/codecs/wm8998.c | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-)
Signature · 1 line
2.25.4
PATCH v2 1/4 ASoC: arizona: Fix a wrong free in wm8997_probe
In the normal path, we should not free the arizona, we should return immediately. It will be free when call remove operation.
--- sound/soc/codecs/wm8997.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/wm8997.c +2 -0
@@ -1177,6 +1177,8 @@ static int wm8997_probe(struct platform_device *pdev) goto err_spk_irqs; } +return ret; + err_spk_irqs:arizona_free_spk_irqs (arizona);
Signature · 1 line
2.25.4
Re: [PATCH v2 1/4] ASoC: arizona: Fix a wrong free in wm8997_probe
Quoted 17 lines · Zhang Qilong
In the normal path, we should not free the arizona, we should return immediately. It will be free when call remove operation.
Fixes 31833ead95c2c ("ASoC: arizona: Move request of speaker IRQs into bus probe")Reported-by Richard Fitzgerald <[email protected]>Signed-off-by Zhang Qilong <[email protected]>--- sound/soc/codecs/wm8997.c | 2 ++ 1 file changed, 2 insertions(+)sound/soc/codecs/wm8997.c +0
-0
sound/soc/codecs/wm8997.c static int wm8997_probe(struct platform_device *pdev) · line 1184
Quoted 8 lines
sound/soc/codecs/wm8997.c +2
-0@@ -1177,6 +1177,8 @@ static int wm8997_probe(struct platform_device *pdev) goto err_spk_irqs; } +return ret; + err_spk_irqs:arizona_free_spk_irqs (arizona);
PATCH v2 2/4 ASoC: arizona: Fix PM disable depth imbalance on error
In reply to Zhang QilongThe pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- sound/soc/codecs/wm8997.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8997.c +4 -2
@@ -1163,10 +1163,10 @@ static int wm8997_probe(struct platform_device *pdev) ret =arizona_init_vol_limit (arizona);if (ret <0 ) -return ret; + goto err_pm_disable; ret =arizona_init_spk_irqs (arizona);if (ret <0 ) -return ret; + goto err_pm_disable; ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_wm8997,
@@ -1181,6 +1181,8 @@ static int wm8997_probe(struct platform_device *pdev) err_spk_irqs:arizona_free_spk_irqs (arizona); +err_pm_disable: +pm_runtime_disable (&pdev->dev);return ret; }
Signature · 1 line
2.25.4
PATCH v2 3/4 ASoC: wm8994: Fix PM disable depth imbalance on error
In reply to Zhang QilongThe pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- sound/soc/codecs/wm8994.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/soc/codecs/wm8994.c +5 -1
@@ -4645,8 +4645,12 @@ static int wm8994_probe(struct platform_device *pdev)pm_runtime_enable (&pdev->dev);pm_runtime_idle (&pdev->dev); -return devm_snd_soc_register_component (&pdev->dev, &soc_component_dev_wm8994, + ret =devm_snd_soc_register_component (&pdev->dev, &soc_component_dev_wm8994, wm8994_dai,ARRAY_SIZE (wm8994_dai)); +if (ret <0 ) +pm_runtime_disable (&pdev->dev); + +return ret; }static int wm8994_remove (struct platform_device *pdev)
Signature · 1 line
2.25.4
PATCH v2 4/4 ASoC: wm8998: Fix PM disable depth imbalance on error
In reply to Zhang QilongThe pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- sound/soc/codecs/wm8998.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/codecs/wm8998.c +3 -1
@@ -1375,7 +1375,7 @@ static int wm8998_probe(struct platform_device *pdev) ret =arizona_init_spk_irqs (arizona);if (ret <0 ) -return ret; + goto err_pm_disable; ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_wm8998,
@@ -1390,6 +1390,8 @@ static int wm8998_probe(struct platform_device *pdev) err_spk_irqs:arizona_free_spk_irqs (arizona); +err_pm_disable: +pm_runtime_disable (&pdev->dev);return ret; }
Signature · 1 line
2.25.4
Mark Brown
maintainerQuoted 11 lines · Zhang Qilong
The first patch fixed a wrong free in
wm8997_probe. The remaining three patches fixed PM disable depth imbalance on error handling.Zhang Qilong (4):
ASoC: arizona: Fix a wrong free inwm8997_probe
ASoC: arizona: Fix PM disable depth imbalance on error
ASoC: wm8994: Fix PM disable depth imbalance on error
ASoC: wm8998: Fix PM disable depth imbalance on error[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: arizona: Fix a wrong free in wm8997_probe
commit: 5e7aace13df24ff72511f29c14ebbfe638ef733c
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark