summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-01-05 23:46:20 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-12 11:51:25 +0100
commit3f08087826950de4688da0aea4e4f64f536fcdd6 (patch)
tree6efcadc5c4efc54e0603d2faee5fc0e99223ce39
parentabe81f3b8ed2996e1712d26d38ff6b73f582c616 (diff)
downloadlinux-3f08087826950de4688da0aea4e4f64f536fcdd6.tar.bz2
serial: 8250_lpss: avoid potential kernel crash when remove
This is a follow up to the commit a9b01b5823f7 ("serial: 8250_mid fix calltrace when hotplug 8250 serial controller") in which the kernel crash was described for another 8250 based driver. It appears that we have the very same issue in 8250_lpss. Fix it by unregistering serial driver first. Cc: Liwei Song <liwei.song@windriver.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/8250/8250_lpss.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
index 58cbb30a9401..f3ea90f0e411 100644
--- a/drivers/tty/serial/8250/8250_lpss.c
+++ b/drivers/tty/serial/8250/8250_lpss.c
@@ -332,10 +332,10 @@ static void lpss8250_remove(struct pci_dev *pdev)
{
struct lpss8250 *lpss = pci_get_drvdata(pdev);
+ serial8250_unregister_port(lpss->line);
+
if (lpss->board->exit)
lpss->board->exit(lpss);
-
- serial8250_unregister_port(lpss->line);
}
static const struct lpss8250_board byt_board = {