]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: soc-core: Fix probe deferral following prelink failure
authorJonathan Hunter <jonathanh@nvidia.com>
Mon, 4 Mar 2019 13:31:14 +0000 (13:31 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 4 Mar 2019 15:23:41 +0000 (15:23 +0000)
Commit 78a24e10cd94 ("ASoC: soc-core: clear platform pointers on error")
re-worked the clean-up of any platform pointers that may have been
initialised by the function snd_soc_init_platform(). This commit missed
one error path where if any of the prelinks for a soundcard failed to
initialise, then these platform pointers would not be cleaned-up. This
then prevents the soundcard from being initialised following a probe
deferral when any of the soundcard prelinks cannot be found.

Fix this by ensuring that soc_cleanup_platform() is called when
initialising the soundcard prelinks fails.

Fixes: 78a24e10cd94 ("ASoC: soc-core: clear platform pointers on error")
Signed-off-by: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c

index 93d316d5bf8e3cac63d9955cfa9e0a6b7bbbb9d0..5a5764dba1479cd1055567dede9b1863570bc1c8 100644 (file)
@@ -2797,6 +2797,7 @@ int snd_soc_register_card(struct snd_soc_card *card)
 
                ret = soc_init_dai_link(card, link);
                if (ret) {
+                       soc_cleanup_platform(card);
                        dev_err(card->dev, "ASoC: failed to init link %s\n",
                                link->name);
                        mutex_unlock(&client_mutex);