From 031734b7d6532633d0cde73475c30646bf37cd6d Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 18 Jan 2018 01:13:54 +0000 Subject: ASoC: soc-core: add missing EXPORT_SYMBOL_GPL() for snd_soc_rtdcom_lookup Reported-by: Atsushi Nemoto Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/soc/soc-core.c') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b9ca939fd05c..9b79c2199781 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -598,6 +598,7 @@ struct snd_soc_component *snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd, return NULL; } +EXPORT_SYMBOL_GPL(snd_soc_rtdcom_lookup); struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, const char *dai_link, int stream) -- cgit v1.2.3 From 971da24c48a9447fb7a3c7805812fd5f443ca008 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 23 Jan 2018 00:41:24 +0000 Subject: ASoC: soc-core: snd_soc_rtdcom_lookup() cares component driver name snd_soc_rtdcom_lookup() look up component by uisng driver name. Then, it uses component->driver->name. Some driver might doesn't have it, thus it should care NULL pointer. This patch solve this issue. Reported-by: Mukunda,Vijendar Reported-by: Manuel Lauss Signed-off-by: Kuninori Morimoto Tested-by: Mukunda,Vijendar Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sound/soc/soc-core.c') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9b79c2199781..52b2e04cc5e2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -590,9 +590,17 @@ struct snd_soc_component *snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd, { struct snd_soc_rtdcom_list *rtdcom; + if (!driver_name) + return NULL; + for_each_rtdcom(rtd, rtdcom) { - if ((rtdcom->component->driver->name == driver_name) || - strcmp(rtdcom->component->driver->name, driver_name) == 0) + const char *component_name = rtdcom->component->driver->name; + + if (!component_name) + continue; + + if ((component_name == driver_name) || + strcmp(component_name, driver_name) == 0) return rtdcom->component; } -- cgit v1.2.3