serial: max310x: Unprepare and disable clock in error path
PATCH 1/1 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]>
--- drivers/tty/serial/max310x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/max310x.c +2 -1
@@ -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) {
Signature · 1 line
2.30.2