* [PATCH] ASoC: core: Fail probe if we fail to add dai widgets
@ 2014-03-31 14:47 Nariman Poushin
2014-04-01 12:30 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Nariman Poushin @ 2014-03-31 14:47 UTC (permalink / raw)
To: broonie; +Cc: alsa-devel, patches
Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
---
sound/soc/soc-core.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b322cf2..5cf7107 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1132,8 +1132,15 @@ static int soc_probe_codec(struct snd_soc_card *card,
driver->num_dapm_widgets);
/* Create DAPM widgets for each DAI stream */
- list_for_each_entry(dai, &codec->component.dai_list, list)
- snd_soc_dapm_new_dai_widgets(&codec->dapm, dai);
+ list_for_each_entry(dai, &codec->component.dai_list, list) {
+ ret = snd_soc_dapm_new_dai_widgets(&codec->dapm, dai);
+
+ if (ret != 0) {
+ dev_err(codec->dev,
+ "Failed to create DAI widgets %d\n", ret);
+ goto err_probe;
+ }
+ }
codec->dapm.idle_bias_off = driver->idle_bias_off;
--
1.8.5.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: core: Fail probe if we fail to add dai widgets
2014-03-31 14:47 [PATCH] ASoC: core: Fail probe if we fail to add dai widgets Nariman Poushin
@ 2014-04-01 12:30 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-04-01 12:30 UTC (permalink / raw)
To: Nariman Poushin; +Cc: alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 765 bytes --]
On Mon, Mar 31, 2014 at 03:47:12PM +0100, Nariman Poushin wrote:
> Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
So, I've applied this on the basis that it'll at least print an error
but...
> + list_for_each_entry(dai, &codec->component.dai_list, list) {
> + ret = snd_soc_dapm_new_dai_widgets(&codec->dapm, dai);
> +
> + if (ret != 0) {
> + dev_err(codec->dev,
> + "Failed to create DAI widgets %d\n", ret);
> + goto err_probe;
> + }
> + }
...this doesn't actually do any cleanup of the widgets that were added
if the failure isn't the first one in the loop (which is a prexisting
bug with the handling of errors on probe()). We're also not checking the
_new_controls() immediately before (but again, that's a prexisting bug).
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-01 12:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 14:47 [PATCH] ASoC: core: Fail probe if we fail to add dai widgets Nariman Poushin
2014-04-01 12:30 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.