FAILED: patch "[PATCH] ASoC: topology: Fix memleak in soc_tplg_manifest_load()" failed to apply to 4.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 242c46c023610dbc0213fc8fb6b71eb836bc5d95 Mon Sep 17 00:00:00 2001
From: Dragos Tarcatu <[email protected]>
Date: Fri, 7 Feb 2020 20:53:25 +0200
Subject: [PATCH] ASoC: topology: Fix memleak in soc_tplg_manifest_load()
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.
sound/soc/soc-topology.c +6 -6
@@ -2544,7 +2544,7 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, {struct snd_soc_tplg_manifest *manifest, *_manifest;bool abi_match; -int err; +int ret =0 ;if (tplg->pass !=SOC_TPLG_PASS_MANIFEST )return 0 ;
@@ -2557,19 +2557,19 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, _manifest = manifest; }else { abi_match = false; - err =manifest_new_ver (tplg, manifest, &_manifest); -if (err <0 ) -return err; + ret =manifest_new_ver (tplg, manifest, &_manifest); +if (ret <0 ) +return ret; }/* pass control to component driver for optional further init */ if (tplg->comp && tplg->ops && tplg->ops->manifest) -return tplg->ops->manifest (tplg->comp, tplg->index, _manifest); + ret = tplg->ops->manifest (tplg->comp, tplg->index, _manifest);if (!abi_match)/* free the duplicated one */ kfree (_manifest); -return 0 ; +return ret; }/* validate header magic, size and type */
PATCH 1/1 ASoC: topology: Fix memleak in soc_tplg_manifest_load()
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.
--- sound/soc/soc-topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/soc/soc-topology.c +6 -6
@@ -2330,7 +2330,7 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, {struct snd_soc_tplg_manifest *manifest, *_manifest;bool abi_match; -int err; +int ret =0 ;if (tplg->pass !=SOC_TPLG_PASS_MANIFEST )return 0 ;
@@ -2343,19 +2343,19 @@ static int soc_tplg_manifest_load(struct soc_tplg *tplg, _manifest = manifest; }else { abi_match = false; - err =manifest_new_ver (tplg, manifest, &_manifest); -if (err <0 ) -return err; + ret =manifest_new_ver (tplg, manifest, &_manifest); +if (ret <0 ) +return ret; }/* pass control to component driver for optional further init */ if (tplg->comp && tplg->ops && tplg->ops->manifest) -return tplg->ops->manifest (tplg->comp, _manifest); + ret = tplg->ops->manifest (tplg->comp, _manifest);if (!abi_match)/* free the duplicated one */ kfree (_manifest); -return 0 ; +return ret; }/* validate header magic, size and type */
Signature · 1 line
2.17.1
Greg KH
maintainerRe: [PATCH v4.14] ASoC: topology: Fix memleak in soc_tplg_manifest_load()
Quoted 8 lines · Dragos Tarcatu
commit
242c46c023610dbc0213fc8fb6b71eb836bc5d95upstream.In case of ABI version mismatch,
_manifestneeds 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 ofmanifest()instead of returning directly.
Quoted 7 lines
Fixes 583958fa2e52 ("ASoC: topology: Make manifest backward compatible from ABI v4")Signed-off-by Dragos Tarcatu <[email protected]>Signed-off-by Mark Brown <[email protected]>--- sound/soc/soc-topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Thanks for the backport, now queued up.
greg k-h