From: Greg Kroah-Hartman Date: Tue, 10 Mar 2020 14:43:52 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.4.216~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af5d337b30f82a299f8ce5661b459f09100893a0;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch --- diff --git a/queue-4.14/asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch b/queue-4.14/asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch new file mode 100644 index 00000000000..38372c356ee --- /dev/null +++ b/queue-4.14/asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch @@ -0,0 +1,62 @@ +From 242c46c023610dbc0213fc8fb6b71eb836bc5d95 Mon Sep 17 00:00:00 2001 +From: Dragos Tarcatu +Date: Fri, 7 Feb 2020 20:53:25 +0200 +Subject: ASoC: topology: Fix memleak in soc_tplg_manifest_load() + +From: Dragos Tarcatu + +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 +Link: https://lore.kernel.org/r/20200207185325.22320-3-dragos_tarcatu@mentor.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + + +--- + sound/soc/soc-topology.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/sound/soc/soc-topology.c ++++ b/sound/soc/soc-topology.c +@@ -2333,7 +2333,7 @@ static int soc_tplg_manifest_load(struct + { + struct snd_soc_tplg_manifest *manifest, *_manifest; + bool abi_match; +- int err; ++ int ret = 0; + + if (tplg->pass != SOC_TPLG_PASS_MANIFEST) + return 0; +@@ -2346,19 +2346,19 @@ static int soc_tplg_manifest_load(struct + _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 */ diff --git a/queue-4.14/series b/queue-4.14/series index 600eae3f96b..f2f159216d7 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -124,3 +124,4 @@ dmaengine-coh901318-fix-a-double-lock-bug-in-dma_tc_handle.patch powerpc-fix-hardware-pmu-exception-bug-on-powervm-compatibility-mode-systems.patch dm-integrity-fix-a-deadlock-due-to-offloading-to-an-incorrect-workqueue.patch xhci-handle-port-status-events-for-removed-usb3-hcd.patch +asoc-topology-fix-memleak-in-soc_tplg_manifest_load.patch