ASoC: intel: Fix memleak in sst_media_open
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 13 Aug 2020 08:41:10 +0000 (16:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Aug 2020 09:49:12 +0000 (11:49 +0200)
commit7505eeadc5a7a4c4b8e1bdfee25b47069ff2d9f3
tree2cb061145c0d5a918bd7b1a9552d894131b319f5
parent2586fcb08f85dfd8adeeb4103359132459e1ba4e
ASoC: intel: Fix memleak in sst_media_open

[ Upstream commit 062fa09f44f4fb3776a23184d5d296b0c8872eb9 ]

When power_up_sst() fails, stream needs to be freed
just like when try_module_get() fails. However, current
code is returning directly and ends up leaking memory.

Fixes: 0121327c1a68b ("ASoC: Intel: mfld-pcm: add control for powering up/down dsp")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813084112.26205-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/intel/atom/sst-mfld-platform-pcm.c