30 Apr
2015
30 Apr
'15
7:40 p.m.
On 04/30/2015 06:38 PM, Charles Keepax wrote:
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index beb48b6..e557018 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -308,11 +308,19 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, { struct dapm_kcontrol_data *data; struct soc_mixer_control *mc;
const char *name;
int ret;
data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM;
name = kasprintf(GFP_KERNEL, "%s %s", kcontrol->id.name, "Autodisable");
We should only allocate the name if we create a widget, otherwise we are going to leak the memory.
- if (!name) {
ret = -ENOMEM;
goto err_data;
- }
- INIT_LIST_HEAD(&data->paths);