Skip to content

Commit

Permalink
serial: 8250_lpss: avoid potential kernel crash when remove
Browse files Browse the repository at this point in the history
This is a follow up to the commit a9b01b5 ("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>
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed Jan 12, 2017
1 parent abe81f3 commit 3f08087
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/8250/8250_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 3f08087

Please sign in to comment.