[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201203143116.405930-1-hslester96@gmail.com>
Date: Thu, 3 Dec 2020 22:31:16 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Agrawal Akshu <Akshu.Agrawal@....com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] ASoC: amd: add missed checks for clk_get()
cz_da7219_init() does not check the return value of clk_get(),
while da7219_clk_enable() calls clk_set_rate() to dereference
the pointers.
Add checks to fix the problems.
Fixes: bb24a31ed584 ("ASoC: AMD: Configure wclk and bclk of master codec")
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
sound/soc/amd/acp-da7219-max98357a.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c
index a7702e64ec51..d5185cd3106b 100644
--- a/sound/soc/amd/acp-da7219-max98357a.c
+++ b/sound/soc/amd/acp-da7219-max98357a.c
@@ -74,7 +74,12 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
}
da7219_dai_wclk = clk_get(component->dev, "da7219-dai-wclk");
+ if (IS_ERR(da7219_dai_wclk))
+ return PTR_ERR(da7219_dai_wclk);
+
da7219_dai_bclk = clk_get(component->dev, "da7219-dai-bclk");
+ if (IS_ERR(da7219_dai_bclk))
+ return PTR_ERR(da7219_dai_bclk);
ret = snd_soc_card_jack_new(card, "Headset Jack",
SND_JACK_HEADSET | SND_JACK_LINEOUT |
--
2.26.2
Powered by blists - more mailing lists