Patch "ASoC: SOF: topology: Fix mem leak in sof_dai_load()" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-sof-topology-fix-mem-leak-in-sof_dai_load.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ceadf743cdaf9ab2cc28befa1b935108bfbc225f
Author: Kamil Duljas <kamil.duljas@xxxxxxxxx>
Date:   Thu Nov 16 22:39:17 2023 +0100

    ASoC: SOF: topology: Fix mem leak in sof_dai_load()
    
    [ 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@xxxxxxxxx>
    Acked-by: Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231116213926.2034-2-kamil.duljas@xxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index a3a3af252259..37ec671a2d76 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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux