From 5091f1fa177f9e5b455ba8b866fd1cd4bcd8d4d1 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 11 Jan 2019 15:51:07 -0600 Subject: [PATCH 1/2] Revert "ASoC: soc-core: Fix null pointer dereference in soc_find_component" This reverts commit 7c7d68887aa5491fa691eae653a08662bc3808e7. Signed-off-by: Pierre-Louis Bossart --- sound/soc/soc-core.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index df05fb862f4bc8..0934b36645b3ea 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1131,13 +1131,11 @@ static int soc_init_dai_link(struct snd_soc_card *card, } /* - * Defer card registration if platform dai component is not added to + * Defer card registartion if platform dai component is not added to * component list. */ - if (link->platform->of_node || link->platform->name) - if (!soc_find_component(link->platform->of_node, - link->platform->name)) - return -EPROBE_DEFER; + if (!soc_find_component(link->platform->of_node, link->platform->name)) + return -EPROBE_DEFER; /* * CPU device may be specified by either name or OF node, but @@ -1152,12 +1150,11 @@ static int soc_init_dai_link(struct snd_soc_card *card, } /* - * Defer card registration if cpu dai component is not added to + * Defer card registartion if cpu dai component is not added to * component list. */ - if (link->cpu_of_node || link->cpu_name) - if (!soc_find_component(link->cpu_of_node, link->cpu_name)) - return -EPROBE_DEFER; + if (!soc_find_component(link->cpu_of_node, link->cpu_name)) + return -EPROBE_DEFER; /* * At least one of CPU DAI name or CPU device name/node must be From d868f5c068b62be259de1a93f0b2b37346048a18 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 11 Jan 2019 15:51:31 -0600 Subject: [PATCH 2/2] Revert "ASoC: soc-core: defer card probe until all component is added to list" This reverts commit 1cf9dd1487b9709b91a0cac9fc79804076590a0f. Signed-off-by: Pierre-Louis Bossart --- sound/soc/soc-core.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0934b36645b3ea..9fd83dc569ebe6 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1129,14 +1129,6 @@ static int soc_init_dai_link(struct snd_soc_card *card, link->name); return -EINVAL; } - - /* - * Defer card registartion if platform dai component is not added to - * component list. - */ - if (!soc_find_component(link->platform->of_node, link->platform->name)) - return -EPROBE_DEFER; - /* * CPU device may be specified by either name or OF node, but * can be left unspecified, and will be matched based on DAI @@ -1148,14 +1140,6 @@ static int soc_init_dai_link(struct snd_soc_card *card, link->name); return -EINVAL; } - - /* - * Defer card registartion if cpu dai component is not added to - * component list. - */ - if (!soc_find_component(link->cpu_of_node, link->cpu_name)) - return -EPROBE_DEFER; - /* * At least one of CPU DAI name or CPU device name/node must be * specified