Hello Ranjani, You right. My mistake. I will prepare patch v2 Kamil czw., 16 lis 2023 o 19:57 Sridharan, Ranjani <ranjani.sridharan@xxxxxxxxx> napisał(a): > On Thu, 2023-11-16 at 14:28 +0100, Kamil Duljas wrote: > > The function has multiple return points at which it is not released > > previously allocated memory. > > > > Signed-off-by: Kamil Duljas <kamil.duljas@xxxxxxxxx> > > --- > > sound/soc/sof/topology.c | 14 +++++++++----- > > 1 file changed, 9 insertions(+), 5 deletions(-) > > > > diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c > > index a3a3af252259..ef8f8991f025 100644 > > --- a/sound/soc/sof/topology.c > > +++ b/sound/soc/sof/topology.c > > @@ -1736,8 +1736,10 @@ 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; > > + } > > Thanks for the patch, Kamil. I think just the change above should > suffice to fix the memory leak in case of error. For all the other > error paths below, snd_soc_tplg_component_remove() should be able to > handle freeing the spcm and the page tables. > > Thanks, > Ranjani > -- Pozdrawiam, Kamil Duljas