[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231211135147.380223-8-sashal@kernel.org>
Date: Mon, 11 Dec 2023 08:50:09 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Kamil Duljas <kamil.duljas@...il.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Mark Brown <broonie@...nel.org>,
Sasha Levin <sashal@...nel.org>,
pierre-louis.bossart@...ux.intel.com, lgirdwood@...il.com,
yung-chuan.liao@...ux.intel.com, ranjani.sridharan@...ux.intel.com,
daniel.baluta@....com, perex@...ex.cz, tiwai@...e.com,
sound-open-firmware@...a-project.org, linux-sound@...r.kernel.org
Subject: [PATCH AUTOSEL 6.6 08/47] ASoC: SOF: topology: Fix mem leak in sof_dai_load()
From: Kamil Duljas <kamil.duljas@...il.com>
[ Upstream commit 31e721fbd194d5723722eaa21df1d14cee7e12b5 ]
The function has multiple return points at which it is not released
previously allocated memory.
Signed-off-by: Kamil Duljas <kamil.duljas@...il.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>
Link: https://lore.kernel.org/r/20231116213926.2034-2-kamil.duljas@gmail.com
Signed-off-by: Mark Brown <broonie@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
sound/soc/sof/topology.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index a3a3af252259d..37ec671a2d766 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;
+ }
}
dai_drv->dobj.private = spcm;
--
2.42.0
Powered by blists - more mailing lists