ASoC: topology: Fix kcontrol name string handling
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>
Tue, 27 Mar 2018 11:04:04 +0000 (12:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:36:29 +0000 (09:36 +0200)
commit73b969f6a92062a5c1547541a2608d1755a7954b
tree306c48016e46103287cfcda1b440b8f543ab5355
parent7e23ef535073ef8e1684f7b6e967b55dab055bd0
ASoC: topology: Fix kcontrol name string handling

commit 267e2c6fd7ca3d4076d20f9d52d49dc91addfe9d upstream.

Fix the topology kcontrol string handling so that string pointer
references are strdup()ed instead of being copied. This fixes issues
with kcontrol templates on the stack or ones that are freed. Remember
and free the strings too when topology is unloaded.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/soc-topology.c