]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: topology: Fix memory leak of scontrol->name
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 31 Mar 2022 11:48:45 +0000 (14:48 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 4 Apr 2022 13:25:38 +0000 (14:25 +0100)
commit583472b7da147319ebf6ebca6a3727bcbca3466b
treedfc25d53f470dcd946d75ba87a19cb8466845b04
parent86119990d915d4521263b3db7e562a245dffd9a4
ASoC: SOF: topology: Fix memory leak of scontrol->name

The scontrol->name is allocated with kstrdup, it must be freed before the
scontrol is freed to avoid leaking memory.

The constant leaking happens via sof_widget_unload() path on every module
removal.

Fixes: a7a4b1e34c3cd ("ASoC: SOF: topology: Make control parsing IPC agnostic")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220331114845.32747-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/topology.c