]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
ASoC: topology: Fix memleak in soc_tplg_manifest_load()
authorDragos Tarcatu <dragos_tarcatu@mentor.com>
Fri, 7 Feb 2020 18:53:25 +0000 (20:53 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 13 Mar 2020 12:38:51 +0000 (13:38 +0100)
commit7dc0c82d04f6841cefc97417978ae30d27badf76
tree7353609e5b1ff3c7c63b793141b44fac232ee386
parentee29f7ab59d1647369d739dcebad2119266d72e4
ASoC: topology: Fix memleak in soc_tplg_manifest_load()

BugLink: https://bugs.launchpad.net/bugs/1867178
commit 242c46c023610dbc0213fc8fb6b71eb836bc5d95 upstream.

In case of ABI version mismatch, _manifest needs to be freed as
it is just a copy of the original topology manifest. However, if
a driver manifest handler is defined, that would get executed and
the cleanup is never reached. Fix that by getting the return status
of manifest() instead of returning directly.

Fixes: 583958fa2e52 ("ASoC: topology: Make manifest backward compatible from ABI v4")
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Link: https://lore.kernel.org/r/20200207185325.22320-3-dragos_tarcatu@mentor.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
sound/soc/soc-topology.c