Skip to content

Commit 61acaba

Browse files
andy-shevgregkh
authored andcommitted
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: d4d6f03 ("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]>
1 parent 2734d6c commit 61acaba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/tty/serial/max310x.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,8 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty
12931293
freq = uartclk;
12941294
if (freq == 0) {
12951295
dev_err(dev, "Cannot get clock rate\n");
1296-
return -EINVAL;
1296+
ret = -EINVAL;
1297+
goto out_clk;
12971298
}
12981299

12991300
if (xtal) {

0 commit comments

Comments
 (0)