diff options
author | Andy Shevchenko <[email protected]> | 2021-06-25 18:37:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2021-07-21 12:51:54 +0200 |
commit | 61acabaae5ba58b3c32e6e90d24c2c0827fd27a8 (patch) | |
tree | 2edced4947352ac5dc0f016ebeb36da9c67212ef | |
parent | 2734d6c1b1a089fb593ef6a23d4b70903526fe0c (diff) |
serial: max310x: Unprepare and disable clock in error path
In one error case the clock may be left prepared and enabled.
Unprepare and disable clock in that case to balance state of
the hardware.
Fixes: d4d6f03c4fb3 ("serial: max310x: Try to get crystal clock rate from property")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/tty/serial/max310x.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 0c1e4df52215..ef11860cd69e 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1293,7 +1293,8 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty freq = uartclk; if (freq == 0) { dev_err(dev, "Cannot get clock rate\n"); - return -EINVAL; + ret = -EINVAL; + goto out_clk; } if (xtal) { |