aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-08-20 01:05:16 -0400
committerMark Brown <broonie@kernel.org>2019-08-22 13:31:58 -0400
commit8d92bb516831e80fac916701447ee6e9f0a6f0f2 (patch)
treec789190432daf205ba30fbb19fe62a18de66c1d0 /sound
parent43ca5dab978294eae26a36f8989b6f0769da4256 (diff)
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87zhk4zazt.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 1be069c2ac8d..1a17cb1bc03b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2647,6 +2647,9 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
2647{ 2647{
2648 struct snd_soc_dapm_context *dapm; 2648 struct snd_soc_dapm_context *dapm;
2649 2649
2650 INIT_LIST_HEAD(&component->dai_list);
2651 mutex_init(&component->io_mutex);
2652
2650 component->name = fmt_single_name(dev, &component->id); 2653 component->name = fmt_single_name(dev, &component->id);
2651 if (!component->name) { 2654 if (!component->name) {
2652 dev_err(dev, "ASoC: Failed to allocate name\n"); 2655 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 dapm->idle_bias_off = !driver->idle_bias_on; 2666 dapm->idle_bias_off = !driver->idle_bias_on;
2664 dapm->suspend_bias_off = driver->suspend_bias_off; 2667 dapm->suspend_bias_off = driver->suspend_bias_off;
2665 2668
2666 INIT_LIST_HEAD(&component->dai_list);
2667 mutex_init(&component->io_mutex);
2668
2669 return 0; 2669 return 0;
2670} 2670}
2671 2671