The -41 introduced this commit from stable kernel, after reverting it, the sof driver will not print calltrace anymore (#4). And the kernle-5.4 (focal) also backported this commit, but it doesn't introduce the calltrace in the 5.4 kernel. So it looks like to backport this commit to 5.3, we need something else which is not in kernel-5.3 but is in the kernel-5.4.
snd_soc_add_dai_link() might fail. This situation occurs for
instance in a very specific use case where a PCM device and a
Back End DAI link are given identical names in the topology.
When this happens, soc_new_pcm_runtime() fails and then
snd_soc_add_dai_link() returns -ENOMEM when called from
soc_tplg_fe_link_create(). Because of that, the link will not
get added into the card list, so any attempt to remove it later
ends up in a panic.
Fix that by checking the return status and free the memory in case
of an error.
The -41 introduced this commit from stable kernel, after reverting it, the sof driver will not print calltrace anymore (#4). And the kernle-5.4 (focal) also backported this commit, but it doesn't introduce the calltrace in the 5.4 kernel. So it looks like to backport this commit to 5.3, we need something else which is not in kernel-5.3 but is in the kernel-5.4.
commit 063821115e02229 d5fd3de31bad270 d5e30aeb41
Author: Dragos Tarcatu <email address hidden>
Date: Mon Dec 9 18:39:38 2019 -0600
ASoC: topology: Check return value for snd_soc_ add_dai_ link()
BugLink: https:/ /bugs.launchpad .net/bugs/ 1861929
[ Upstream commit 76d2703649321c2 96df7ec0dafd50a dd96215de4 ]
snd_ soc_add_ dai_link( ) might fail. This situation occurs for pcm_runtime( ) fails and then soc_add_ dai_link( ) returns -ENOMEM when called from tplg_fe_ link_create( ). Because of that, the link will not
instance in a very specific use case where a PCM device and a
Back End DAI link are given identical names in the topology.
When this happens, soc_new_
snd_
soc_
get added into the card list, so any attempt to remove it later
ends up in a panic.
Fix that by checking the return status and free the memory in case
of an error.
Reviewed-by: Ranjani Sridharan <email address hidden>
Signed-off-by: Dragos Tarcatu <email address hidden>
Signed-off-by: Pierre-Louis Bossart <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Mark Brown <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>