ASoC: topology: kfree kcontrol->private_value before freeing kcontrol
authorColin Ian King <colin.king@canonical.com>
Fri, 9 Dec 2016 14:17:47 +0000 (14:17 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 15 Dec 2016 11:36:37 +0000 (11:36 +0000)
commitc2b36129ce53a22b89dd2b88db33e7ffdefe0f41
tree4e1d391586c745f556793f2b64a0bf9e041dba26
parenta5de5b74a50113564a1e0850e2da96c37c35e55d
ASoC: topology: kfree kcontrol->private_value before freeing kcontrol

kcontrol->private_value is being kfree'd after kcontrol has been freed
(in previous call to snd_ctl_remove).  Instead, fix this by kfreeing
the private_value before kcontrol.

CoverityScan CID#1388311 "Read from pointer after free"

Fixes: eea3dd4f1247a ("ASoC: topology: Only free TLV for volume mixers of a widget")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c