[alsa-devel] [PATCH] ASoC: damp: Reset dapm wcache after freeing damp widgets

Lars-Peter Clausen lars at metafoo.de
Tue Nov 10 12:31:44 CET 2015


On 11/09/2015 02:30 PM, Jyri Sarha wrote:
[...]
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index ff8bda4..d78db59 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -2286,6 +2286,9 @@ static void dapm_free_widgets(struct snd_soc_dapm_context *dapm)
>  			continue;
>  		snd_soc_dapm_free_widget(w);
>  	}
> +
> +	dapm->path_sink_cache.widget = NULL;
> +	dapm->path_source_cache.widget = NULL;
>  }

Looks good, but this is not the only place where we free widgets. Can you
add a helper function snd_soc_dapm_reset_cache() (or similar) and then call
this from dapm_free_widgets() as well as snd_soc_tplg_widget_remove_all().

- Lars



More information about the Alsa-devel mailing list