Commit 8d92bb51 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: initialize component list

It might return without initializing in error case.
In such case, uninitialized variable might be used at error handler.
This patch initializes all necessary variable before return.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87zhk4zazt.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 43ca5dab
...@@ -2647,6 +2647,9 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, ...@@ -2647,6 +2647,9 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
{ {
struct snd_soc_dapm_context *dapm; struct snd_soc_dapm_context *dapm;
INIT_LIST_HEAD(&component->dai_list);
mutex_init(&component->io_mutex);
component->name = fmt_single_name(dev, &component->id); component->name = fmt_single_name(dev, &component->id);
if (!component->name) { if (!component->name) {
dev_err(dev, "ASoC: Failed to allocate name\n"); dev_err(dev, "ASoC: Failed to allocate name\n");
...@@ -2663,9 +2666,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, ...@@ -2663,9 +2666,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
dapm->idle_bias_off = !driver->idle_bias_on; dapm->idle_bias_off = !driver->idle_bias_on;
dapm->suspend_bias_off = driver->suspend_bias_off; dapm->suspend_bias_off = driver->suspend_bias_off;
INIT_LIST_HEAD(&component->dai_list);
mutex_init(&component->io_mutex);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment