summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@linux-m68k.org>2014-02-28 14:21:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-28 16:39:38 -0800
commitbf13c9a894162a91c8bb7d9555933e9fc3ff7d0e (patch)
treefd58867515aef6102c716239a8c9274635f6b36c /drivers/tty
parent5f5c9ae56c38942623f69c3e6dc6ec78e4da2076 (diff)
downloadlinux-bf13c9a894162a91c8bb7d9555933e9fc3ff7d0e.tar.bz2
serial: sh-sci: Add missing call to uart_remove_one_port() in failure path
If cpufreq_register_notifier() fails, we have to remove the port added by sci_probe_single(), which is not done by sci_cleanup_single(). Else the serial port stays active from the point of view of the serial subsystem, and it may crash when userspace getty is started, or when the loadable driver module is unloaded. This was introduced by commit 6dae14216c85eea13db7b12c469475c5d30e5499 ("serial: sh-sci: Fix probe error paths"). Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/sh-sci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 1668523d31fb..0cb52376f97d 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2564,6 +2564,7 @@ static int sci_probe(struct platform_device *dev)
ret = cpufreq_register_notifier(&sp->freq_transition,
CPUFREQ_TRANSITION_NOTIFIER);
if (unlikely(ret < 0)) {
+ uart_remove_one_port(&sci_uart_driver, &sp->port);
sci_cleanup_single(sp);
return ret;
}