mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ASoC: topology: Fix memleak in soc_tplg_link_elems_load()
commit2b2d5c4db7upstream. If soc_tplg_link_config() fails, _link needs to be freed in case of topology ABI version mismatch. However the current code is returning directly and ends up leaking memory in this case. This patch fixes that. Fixes:593d9e52f9("ASoC: topology: Add support to configure existing physical DAI links") Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com> Link: https://lore.kernel.org/r/20200207185325.22320-2-dragos_tarcatu@mentor.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9998ebb5e7
commit
a6e3b2aedf
@@ -2320,8 +2320,11 @@ static int soc_tplg_link_elems_load(struct soc_tplg *tplg,
|
||||
}
|
||||
|
||||
ret = soc_tplg_link_config(tplg, _link);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
if (!abi_match)
|
||||
kfree(_link);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* offset by version-specific struct size and
|
||||
* real priv data size
|
||||
|
||||
Reference in New Issue
Block a user