mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
ASoC: jz4740-i2s: add missed checks for clk_get()
[ Upstream commit1c1fb2653a
] jz4740_i2s_set_sysclk() does not check the return values of clk_get(), while the file dereferences the pointers in clk_put(). Add the missed checks to fix it. Fixes:11bd3dd1b7
("ASoC: Add JZ4740 ASoC support") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Link: https://lore.kernel.org/r/20201203144227.418194-1-hslester96@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1b760dc9d9
commit
d863d76536
1 changed files with 4 additions and 0 deletions
|
@ -309,10 +309,14 @@ static int jz4740_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id,
|
|||
switch (clk_id) {
|
||||
case JZ4740_I2S_CLKSRC_EXT:
|
||||
parent = clk_get(NULL, "ext");
|
||||
if (IS_ERR(parent))
|
||||
return PTR_ERR(parent);
|
||||
clk_set_parent(i2s->clk_i2s, parent);
|
||||
break;
|
||||
case JZ4740_I2S_CLKSRC_PLL:
|
||||
parent = clk_get(NULL, "pll half");
|
||||
if (IS_ERR(parent))
|
||||
return PTR_ERR(parent);
|
||||
clk_set_parent(i2s->clk_i2s, parent);
|
||||
ret = clk_set_rate(i2s->clk_i2s, freq);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue