diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2015-09-23 08:57:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-22 14:49:34 -0700 |
commit | 14eebe6be1101084897590d0093144e3f0ec41ea (patch) | |
tree | 1b4a3f986094c3d24919d2bee1c9d2a729d1ad8a | |
parent | 9b3902ec193200411a6467aa7b873f23b6444382 (diff) | |
download | lwn-14eebe6be1101084897590d0093144e3f0ec41ea.tar.gz lwn-14eebe6be1101084897590d0093144e3f0ec41ea.zip |
serial: atmel: fix error path of probe function
commit 8f1bd8f2ad2358d6a88c115481ff3e69817d1bde upstream.
If atmel_init_gpios fails the port has already been marked as busy (in
line 2629), so this must be undone in the error path.
This bug was introduced because I created the patch that finally
became 722ccf416ac2 ("serial: atmel: fix error handling when
mctrl_gpio_init fails") on top of 3.19 which didn't have commit
6fbb9bdf0f3f ("tty/serial: at91: fix error handling in
atmel_serial_probe()") yet.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: 722ccf416ac2 ("serial: atmel: fix error handling when mctrl_gpio_init fails")
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/atmel_serial.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 2a8f528153e7..40326b342762 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2641,7 +2641,7 @@ static int atmel_serial_probe(struct platform_device *pdev) ret = atmel_init_gpios(port, &pdev->dev); if (ret < 0) { dev_err(&pdev->dev, "Failed to initialize GPIOs."); - goto err; + goto err_clear_bit; } ret = atmel_init_port(port, pdev); |