summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Cline <jcline@redhat.com>2020-01-23 04:03:42 -0500
committerJeremy Cline <jcline@redhat.com>2020-01-23 04:07:04 -0500
commitce45763b5804988836bf10333dc69ec02c93704d (patch)
tree6087e6f6c5220edf0553f959b0541dbd8be6f286
parent5166b3b763c8a0f1557054e5f178bc9d9d5c3148 (diff)
downloadkernel-ce45763b5804988836bf10333dc69ec02c93704d.tar.gz
kernel-ce45763b5804988836bf10333dc69ec02c93704d.tar.xz
kernel-ce45763b5804988836bf10333dc69ec02c93704d.zip
Pick up an ALSA bug fix for rhbz 1772498
-rw-r--r--ASoC-topology-fix-soc_tplg_fe_link_create-link-dobj-.patch60
-rw-r--r--kernel.spec3
2 files changed, 63 insertions, 0 deletions
diff --git a/ASoC-topology-fix-soc_tplg_fe_link_create-link-dobj-.patch b/ASoC-topology-fix-soc_tplg_fe_link_create-link-dobj-.patch
new file mode 100644
index 000000000..f86069ab9
--- /dev/null
+++ b/ASoC-topology-fix-soc_tplg_fe_link_create-link-dobj-.patch
@@ -0,0 +1,60 @@
+From 29bc8978342b2d94a65801904c44dc7b0ef88da2 Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela <perex@perex.cz>
+Date: Wed, 22 Jan 2020 20:07:52 +0100
+Subject: [PATCH] ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj
+ initialization order
+
+The code which checks the return value for snd_soc_add_dai_link() call
+in soc_tplg_fe_link_create() moved the snd_soc_add_dai_link() call before
+link->dobj members initialization.
+
+While it does not affect the latest kernels, the old soc-core.c code
+in the stable kernels is affected. The snd_soc_add_dai_link() function uses
+the link->dobj.type member to check, if the link structure is valid.
+
+Reorder the link->dobj initialization to make things work again.
+It's harmless for the recent code (and the structure should be properly
+initialized before other calls anyway).
+
+The problem is in stable linux-5.4.y since version 5.4.11 when the
+upstream commit 76d270364932 was applied.
+
+Fixes: 76d270364932 ("ASoC: topology: Check return value for snd_soc_add_dai_link()")
+Cc: Dragos Tarcatu <dragos_tarcatu@mentor.com>
+Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
+Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
+Cc: Mark Brown <broonie@kernel.org>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+---
+ sound/soc/soc-topology.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
+index fd2d22ddc81b..1c143a00633f 100644
+--- a/sound/soc/soc-topology.c
++++ b/sound/soc/soc-topology.c
+@@ -1891,6 +1891,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
+ link->num_codecs = 1;
+ link->num_platforms = 1;
+
++ link->dobj.index = tplg->index;
++ link->dobj.ops = tplg->ops;
++ link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
++
+ if (strlen(pcm->pcm_name)) {
+ link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
+ link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
+@@ -1927,9 +1931,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
+ goto err;
+ }
+
+- link->dobj.index = tplg->index;
+- link->dobj.ops = tplg->ops;
+- link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
+ list_add(&link->dobj.list, &tplg->comp->dobj_list);
+
+ return 0;
+--
+2.24.1
+
diff --git a/kernel.spec b/kernel.spec
index 77880f7e3..5cf4e1173 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -826,6 +826,9 @@ Patch600: alsa-5.5.patch
# ALSA code from v5.6 (Intel ASoC Sound Open Firmware driver support)
Patch601: alsa-5.6.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=1772498#c101
+Patch602: ASoC-topology-fix-soc_tplg_fe_link_create-link-dobj-.patch
+
# END OF PATCH DEFINITIONS
%endif