diff options
| author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2023-09-29 13:32:43 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-03-25 13:03:04 +0300 |
| commit | b9eedeeabe4033ed59384a0ebc438a7680d7d175 (patch) | |
| tree | cad7e31c539be05aa06bcbc979bb84a9b3b14382 /include | |
| parent | eb44a35b6da3f0d393ef87eb27c33626865ec2ca (diff) | |
| download | linux-b9eedeeabe4033ed59384a0ebc438a7680d7d175.tar.xz | |
ASoC: core: Do not call link_exit() on uninitialized rtd objects
[ Upstream commit dd9f9cc1e6b9391140afa5cf27bb47c9e2a08d02 ]
On init we have sequence:
for_each_card_prelinks(card, i, dai_link) {
ret = snd_soc_add_pcm_runtime(card, dai_link);
ret = init_some_other_things(...);
if (ret)
goto probe_end:
for_each_card_rtds(card, rtd) {
ret = soc_init_pcm_runtime(card, rtd);
probe_end:
while on exit:
for_each_card_rtds(card, rtd)
snd_soc_link_exit(rtd);
If init_some_other_things() step fails due to error we end up with
not fully setup rtds and try to call snd_soc_link_exit on them, which
depending on contents on .link_exit handler, can end up dereferencing
NULL pointer.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230929103243.705433-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 95bc5c225513 ("ASoC: soc-core: flush delayed work before removing DAIs and widgets")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/soc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index d63ac6d9fbdc..015d5fff397f 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1110,6 +1110,8 @@ struct snd_soc_pcm_runtime { unsigned int pop_wait:1; unsigned int fe_compr:1; /* for Dynamic PCM */ + bool initialized; + int num_components; struct snd_soc_component *components[]; /* CPU/Codec/Platform */ }; |
