Skip to content

Commit

Permalink
ASoC: core: delete component->card_list in soc_remove_component only
Browse files Browse the repository at this point in the history
We add component->card_list in the end of soc_probe_component(). In
other words, component->card_list will not be added if there is an
error in the soc_probe_component() function. So we can't delete
component->card_list in the error handling of soc_probe_component().

Fixes: 22d1423 ("ASoC: soc-core: add soc_cleanup_component()")
Signed-off-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
bardliao authored and broonie committed Sep 17, 2019
1 parent e75f494 commit a0a4bf5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,6 @@ static void soc_cleanup_component(struct snd_soc_component *component)
/* For framework level robustness */
snd_soc_component_set_jack(component, NULL, NULL);

list_del(&component->card_list);
snd_soc_dapm_free(snd_soc_component_get_dapm(component));
soc_cleanup_component_debugfs(component);
component->card = NULL;
Expand All @@ -991,7 +990,7 @@ static void soc_remove_component(struct snd_soc_component *component)
return;

snd_soc_component_remove(component);

list_del(&component->card_list);
soc_cleanup_component(component);
}

Expand Down

0 comments on commit a0a4bf5

Please sign in to comment.