Skip to content

Commit f3ee909

Browse files
tititiou36broonie
authored andcommitted
ASoC: topology: Fix a potential memory leak in 'soc_tplg_dapm_widget_denum_create()'
If this sanity check fails, we must free the memory that has already been allocated. So we must go to 'err' as in the other error handling parth of this function. Fixes: 1a7dd6e ("ASoC: topology: Allow a widget to have multiple enum controls") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6d5574e commit f3ee909

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/soc-topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
13011301
/* validate kcontrol */
13021302
if (strnlen(ec->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
13031303
SNDRV_CTL_ELEM_ID_NAME_MAXLEN)
1304-
return NULL;
1304+
goto err;
13051305

13061306
se = kzalloc(sizeof(*se), GFP_KERNEL);
13071307
if (se == NULL)

0 commit comments

Comments
 (0)