diff options
| author | Lars-Peter Clausen <lars@metafoo.de> | 2013-06-14 07:16:51 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2013-06-14 07:34:10 -0400 |
| commit | 6b75bf0c5b17d71c3b0568caaaaae73a22f83826 (patch) | |
| tree | ef3d43f133e5a7962534f7caa005689268776f4e | |
| parent | 317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff) | |
ASoC: dapm: Setup private_free callback for dapm kcontrols
The private data containing the widget list that is a assigned to a DAPM
kcontrol is never freed. Setup the private_free for DAPM kcontrols to take care
of this.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
| -rw-r--r-- | sound/soc/soc-dapm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index a80c883bb8be..9dd2d1d63981 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
| @@ -504,6 +504,11 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, | |||
| 504 | return 0; | 504 | return 0; |
| 505 | } | 505 | } |
| 506 | 506 | ||
| 507 | static void dapm_kcontrol_free(struct snd_kcontrol *kctl) | ||
| 508 | { | ||
| 509 | kfree(kctl->private_data); | ||
| 510 | } | ||
| 511 | |||
| 507 | /* | 512 | /* |
| 508 | * Determine if a kcontrol is shared. If it is, look it up. If it isn't, | 513 | * Determine if a kcontrol is shared. If it is, look it up. If it isn't, |
| 509 | * create it. Either way, add the widget into the control's widget list | 514 | * create it. Either way, add the widget into the control's widget list |
| @@ -617,6 +622,7 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w, | |||
| 617 | 622 | ||
| 618 | kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], wlist, name, | 623 | kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], wlist, name, |
| 619 | prefix); | 624 | prefix); |
| 625 | kcontrol->private_free = dapm_kcontrol_free; | ||
| 620 | ret = snd_ctl_add(card, kcontrol); | 626 | ret = snd_ctl_add(card, kcontrol); |
| 621 | if (ret < 0) { | 627 | if (ret < 0) { |
| 622 | dev_err(dapm->dev, | 628 | dev_err(dapm->dev, |
