mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
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: 0814e8d5da
("sc16is7xx: enable the clock")
Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2468b3e4aa
commit
e76785d092
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue