--- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2335,8 +2335,11 @@ static int soc_tplg_link_elems_load(stru } 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