Skip to contentSkip to conversation

serial: max310x: Unprepare and disable clock in error path

PATCH New Andy Shevchenko 1 participant 1 message Jun 25, 2021 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

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")
---
 drivers/tty/serial/max310x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/max310x.c +2 -1
index 0c1e4df52215..ef11860cd69e 100644
@@ -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