Skip to content

Commit 2ca71b8

Browse files
plbossartgregkh
authored andcommitted
ASoC: topology: fix tlvs in error handling for widget_dmixer
commit 8edac48 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a4fd00d commit 2ca71b8

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
@@ -1394,14 +1394,14 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
13941394
if (err < 0) {
13951395
dev_err(tplg->dev, "ASoC: failed to init %s\n",
13961396
mc->hdr.name);
1397-
soc_tplg_free_tlv(tplg, &kc[i]);
13981397
goto err_sm;
13991398
}
14001399
}
14011400
return kc;
14021401

14031402
err_sm:
14041403
for (; i >= 0; i--) {
1404+
soc_tplg_free_tlv(tplg, &kc[i]);
14051405
sm = (struct soc_mixer_control *)kc[i].private_value;
14061406
kfree(sm);
14071407
kfree(kc[i].name);

0 commit comments

Comments
 (0)