]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: topology: free kcontrol memory on error
authorDragos Tarcatu <dragos_tarcatu@mentor.com>
Mon, 11 Nov 2019 22:20:38 +0000 (16:20 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 12 Nov 2019 17:12:27 +0000 (17:12 +0000)
commit86b0093d82ea3b6a30277f08b82225301edc09a7
tree1e903c0cc7e0b30fae054af99dd2a31e69c31d63
parent6be5c93df45382683a076ef0b5fd52938ab0bb2b
ASoC: SOF: topology: free kcontrol memory on error

The volume and bytes kcontrols are currently not freeing their
memory on initialization failures. When an error occurs, all the
widgets loaded so far are unloaded via sof_widget_unload().
But this only happens for the widgets that got successfully loaded.

Fix that by kfree()-ing the allocated memory on load error.

Fixes: 623b3c4abb2be ("ASoC: SOF: Add support for loading topologies")
Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191111222039.19651-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/topology.c