]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
authorJaroslav Kysela <perex@perex.cz>
Wed, 22 Jan 2020 19:07:52 +0000 (20:07 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 23 Jan 2020 12:11:11 +0000 (12:11 +0000)
commitdb2176bf977373b9e18b27716919cc526f4842d9
treef9a3e9eee0b78ac068a65bd376f7cc9faba727ac
parent4382510828bbeb7f648ddc9a9ac2da563d6f1ae8
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 e50ea4287cae was applied.

Fixes: e50ea4287cae ("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>
Link: https://lore.kernel.org/r/20200122190752.3081016-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c