Commit 31e721fb authored by Kamil Duljas's avatar Kamil Duljas Committed by Mark Brown

ASoC: SOF: topology: Fix mem leak in sof_dai_load()

The function has multiple return points at which it is not released
previously allocated memory.
Signed-off-by: default avatarKamil Duljas <kamil.duljas@gmail.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231116213926.2034-2-kamil.duljas@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c1501f25
......@@ -1736,9 +1736,11 @@ static int sof_dai_load(struct snd_soc_component *scomp, int index,
/* perform pcm set op */
if (ipc_pcm_ops && ipc_pcm_ops->pcm_setup) {
ret = ipc_pcm_ops->pcm_setup(sdev, spcm);
if (ret < 0)
if (ret < 0) {
kfree(spcm);
return ret;
}
}
dai_drv->dobj.private = spcm;
list_add(&spcm->list, &sdev->pcm_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment