提交 e76785d0 编写于 作者: S Stefan Potyra 提交者: Greg Kroah-Hartman

sc16is7xx: Check for an error when the clock is enabled.

When the clock is enabled, check if there is an error. Otherwise
clk_get_rate() can be called without enabled clock.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 0814e8d5 ("sc16is7xx: enable the clock")
Signed-off-by: NStefan Potyra <Stefan.Potyra@elektrobit.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2468b3e4
......@@ -1168,7 +1168,10 @@ static int sc16is7xx_probe(struct device *dev,
else
return PTR_ERR(s->clk);
} else {
clk_prepare_enable(s->clk);
ret = clk_prepare_enable(s->clk);
if (ret)
return ret;
freq = clk_get_rate(s->clk);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册