]> 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)
commit3bdc09c690a0a9cbd769219e9f09760adff1f91c
tree1e903c0cc7e0b30fae054af99dd2a31e69c31d63
parent012b5f715f1d724e77bde0343ac1d71eb8e73d69
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: c45f1ff8c8b63 ("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