diff mbox series

ASoC: tlv320aic32x4: add a check for devm_clk_get

Message ID 20191018081448.8486-1-hslester96@gmail.com (mailing list archive)
State Accepted
Commit 1092b09708882e3c216f0b9c02e606b3c0942c5b
Headers show
Series ASoC: tlv320aic32x4: add a check for devm_clk_get | expand

Commit Message

Chuhong Yuan Oct. 18, 2019, 8:14 a.m. UTC
aic32x4_set_dai_sysclk misses a check for devm_clk_get and may miss the
failure.
Add a check to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 sound/soc/codecs/tlv320aic32x4.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 68165de1c8de..b4e9a6c73f90 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -573,6 +573,9 @@  static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
 	struct clk *pll;
 
 	pll = devm_clk_get(component->dev, "pll");
+	if (IS_ERR(pll))
+		return PTR_ERR(pll);
+
 	mclk = clk_get_parent(pll);
 
 	return clk_set_rate(mclk, freq);