Skip to content

Commit 8edac48

Browse files
plbossartbroonie
authored andcommitted
ASoC: topology: fix tlvs in error handling for widget_dmixer
we need to free all allocated tlvs, not just the one allocated in the loop before releasing kcontrols - other the tlvs references will leak. Fixes: 9f90af3 ('ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow') Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 6f0307d commit 8edac48

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
@@ -1371,14 +1371,14 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
13711371
if (err < 0) {
13721372
dev_err(tplg->dev, "ASoC: failed to init %s\n",
13731373
mc->hdr.name);
1374-
soc_tplg_free_tlv(tplg, &kc[i]);
13751374
goto err_sm;
13761375
}
13771376
}
13781377
return kc;
13791378

13801379
err_sm:
13811380
for (; i >= 0; i--) {
1381+
soc_tplg_free_tlv(tplg, &kc[i]);
13821382
sm = (struct soc_mixer_control *)kc[i].private_value;
13831383
kfree(sm);
13841384
kfree(kc[i].name);

0 commit comments

Comments
 (0)