mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
ASoC: topology: Dont free template strings whilst they are in use.
Template name pointers are copied when creating new widgets and are freed in widget destroy. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
cc9d4714a8
commit
c3421a6a65
1 changed files with 1 additions and 2 deletions
|
@ -1477,6 +1477,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
|
|||
if (template.id < 0)
|
||||
return template.id;
|
||||
|
||||
/* strings are allocated here, but used and freed by the widget */
|
||||
template.name = kstrdup(w->name, GFP_KERNEL);
|
||||
if (!template.name)
|
||||
return -ENOMEM;
|
||||
|
@ -1589,8 +1590,6 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
|
|||
widget->dobj.widget.kcontrol_type = kcontrol_type;
|
||||
widget->dobj.ops = tplg->ops;
|
||||
widget->dobj.index = tplg->index;
|
||||
kfree(template.sname);
|
||||
kfree(template.name);
|
||||
list_add(&widget->dobj.list, &tplg->comp->dobj_list);
|
||||
|
||||
ret = soc_tplg_widget_ready(tplg, widget, w);
|
||||
|
|
Loading…
Reference in a new issue