mbox series

[0/2] ASoC: topology: Fix memory leaks with ABI version mismatch

Message ID 20200207185325.22320-1-dragos_tarcatu@mentor.com
Headers show
Series ASoC: topology: Fix memory leaks with ABI version mismatch | expand

Message

Dragos Tarcatu Feb. 7, 2020, 6:53 p.m. UTC
The topology loader in soc-topology.c is currently accepting ABI
version mismatches for some topology components in order to keep
backwards compatibility with ABIv4. When dealing with these ABI
mismatch situations, temporary copies of the v4 objects are
allocated and passed on to the right driver topology handlers.
After that they're supposed to be freed.

However, memory leaks are currently possible in
soc_tplg_link_elems_load() and also soc_tplg_manifest_load().

These patches fix these.

I've originally created a PR on github for SOF at:
   https://github.com/thesofproject/linux/pull/1771
as my impression was this can affect older SOF toplogies.

But as it turns out this may impact Skylake instead.

Dragos Tarcatu (2):
  ASoC: topology: Fix memleak in soc_tplg_link_elems_load()
  ASoC: topology: Fix memleak in soc_tplg_manifest_load()

 sound/soc/soc-topology.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)