Skip to contentSkip to conversation

Asoc: qcom: lpass-platform: Fix memory leak

PATCH Applied Srinivasa Rao Mandadapu 3 participants 4 messages Nov 15, 2020 – Dec 29, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Asoc: qcom: lpass-platform: Fix memory leak

lpass_pcm_data is not freed in error paths. Free it in error paths to avoid memory leak.

Fixes 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage")
---
 sound/soc/qcom/lpass-platform.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/qcom/lpass-platform.c +4 -1
index 36d1512..7a3fdf8 100644
@@ -122,8 +122,10 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
 	else
 		dma_ch = 0;
 
-	if (dma_ch < 0)
+	if (dma_ch < 0) {
+		kfree(data);
 		return dma_ch;
+	}
 
 	if (cpu_dai->driver->id == LPASS_DP_RX) {
 		map = drvdata->hdmiif_map;
@@ -147,6 +149,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component,
 	ret = snd_pcm_hw_constraint_integer(runtime,
 			SNDRV_PCM_HW_PARAM_PERIODS);
 	if (ret < 0) {
+		kfree(data);
 		dev_err(soc_runtime->dev, "setting constraints failed: %d\n",
 			ret);
 		return -EINVAL;
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
maintainer
#1 lore raw
Quoted 2 lines · Srinivasa Rao Mandadapu

lpass_pcm_data is not freed in error paths. Free it in error paths to avoid memory leak.

Please use subject lines reflecting the general style for the subsystem, it makes it easier for people to spot patches that need to be reviewed.

maintainer
#2 lore raw
In reply to Srinivasa Rao Mandadapu
Quoted 4 lines · Srinivasa Rao Mandadapu

lpass_pcm_data is not freed in error paths. Free it in error paths to avoid memory leak.

Fixes 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage")

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: qcom: lpass-platform: Fix memory leak

      commit: bd6327fda2f3ded85b69b3c3125c99aaa51c7881

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

#3 lore raw
In reply to Srinivasa Rao Mandadapu
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 10 lines · On Sun, 15 Nov 2020 10:26:50 +0530 you wrote:

lpass_pcm_data is not freed in error paths. Free it in error paths to avoid memory leak.

Fixes 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage")

[...]

Here is the summary with links:
- Asoc: qcom: lpass-platform: Fix memory leak

    https://git.kernel.org/qcom/c/bd6327fda2f3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html