Unverified Commit 1b4efdaf authored by Dragos Tarcatu's avatar Dragos Tarcatu Committed by Mark Brown
Browse files

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: 311ce4fe ("ASoC: SOF: Add support for loading topologies")
Reviewed-by: default avatarPaul Olaru <paul.olaru@nxp.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarDragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: default avatarPierre-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: default avatarMark Brown <broonie@kernel.org>
parent 5e35d5f4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment