]> 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)
commit33e45215e831f717176f3d27607cc60ac13ff616
treedfc25d53f470dcd946d75ba87a19cb8466845b04
parentf4a4ba567b227dbe31289febc36050d4ec11cebc
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: 806f4f0b3d816 ("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