]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: topology: fix memory leaks on sm, se and sbe
authorColin Ian King <colin.king@canonical.com>
Thu, 27 Jun 2019 13:32:08 +0000 (14:32 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 28 Jun 2019 14:08:49 +0000 (15:08 +0100)
commit777c9053500e2e3622888031679b1b6be5559c24
tree175baf6ff9f597824379ae65961bfe1491d15468
parent19715c28f77298a62d87da3258bfc13640de4237
ASoC: topology: fix memory leaks on sm, se and sbe

Currently when a kstrdup fails the error exit paths don't free
the allocations for sm, se and sbe.  This can be fixed by assigning
kc[i].private_value to these before doing the ksrtdup so that the error
exit path will be able to free these objects.

Addresses-Coverity: ("Resource leak")
Fixes: 04095d187ee8 ("ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c