From: Alexander Shiyan Date: Tue, 7 Jun 2016 15:59:26 +0000 (+0300) Subject: serial: max310x: Unregister UARTs on error X-Git-Tag: v4.8-rc1~192^2~26 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c8246fefe2c995e128345614fb98b5ed5014318b;p=karo-tx-linux.git serial: max310x: Unregister UARTs on error Add uart_remove_one_port() for error path. Signed-off-by: Alexander Shiyan Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index e73ae6e79b64..347f6e8dae39 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1234,6 +1234,9 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, dev_err(dev, "Unable to reguest IRQ %i\n", irq); + for (i = 0; i < devtype->nr; i++) + uart_remove_one_port(&max310x_uart, &s->p[i].port); + mutex_destroy(&s->mutex); out_clk: