[alsa-devel] [PATCH] ASoC: dapm: Fix kcontrol widget name memory management

Charles Keepax ckeepax at opensource.wolfsonmicro.com
Thu Jul 9 10:06:12 CEST 2015


On Wed, Jul 08, 2015 at 09:59:59PM +0200, Lars-Peter Clausen wrote:
> The name field of the widget template is only used inside
> snd_soc_dapm_new_control_unlocked() which allocates a copy for the actual
> widget. This means we need to free the name allocated for the template in
> dapm_kcontrol_data_alloc() and not the name of the actual widget in
> dapm_kcontrol_free(). Otherwise we get a double free on the widget name and
> a memory leak on the template name.
> 
> Fixes: 773da9b358bf ("ASoC: dapm: Append "Autodisable" to autodisable widget names")
> Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>
> ---

Oops, thanks for fixing that up.

Acked-by: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>

Thanks,
Charles


More information about the Alsa-devel mailing list