summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-topology.c
diff options
context:
space:
mode:
authorChristophe JAILLET2017-09-14 22:44:24 +0200
committerMark Brown2017-09-14 23:13:03 +0200
commitf3ee9096fcaf55eae37dfb58603c4dbff6f0a7c9 (patch)
treeae96a0f7df22415824b9f5de9cd8db403594c890 /sound/soc/soc-topology.c
parentASoC: topology: Fix a potential NULL pointer dereference in 'soc_tplg_dapm_wi... (diff)
downloadkernel-qcow2-linux-f3ee9096fcaf55eae37dfb58603c4dbff6f0a7c9.tar.gz
kernel-qcow2-linux-f3ee9096fcaf55eae37dfb58603c4dbff6f0a7c9.tar.xz
kernel-qcow2-linux-f3ee9096fcaf55eae37dfb58603c4dbff6f0a7c9.zip
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: 1a7dd6e2f192 ("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>
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r--sound/soc/soc-topology.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 2499b54a57e8..01a50413c66f 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1301,7 +1301,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
/* validate kcontrol */
if (strnlen(ec->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
SNDRV_CTL_ELEM_ID_NAME_MAXLEN)
- return NULL;
+ goto err;
se = kzalloc(sizeof(*se), GFP_KERNEL);
if (se == NULL)