提交 3f080878 编写于 作者: A Andy Shevchenko 提交者: Greg Kroah-Hartman

serial: 8250_lpss: avoid potential kernel crash when remove

This is a follow up to the commit a9b01b58 ("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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NBryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 abe81f3b
...@@ -332,10 +332,10 @@ static void lpss8250_remove(struct pci_dev *pdev) ...@@ -332,10 +332,10 @@ static void lpss8250_remove(struct pci_dev *pdev)
{ {
struct lpss8250 *lpss = pci_get_drvdata(pdev); struct lpss8250 *lpss = pci_get_drvdata(pdev);
serial8250_unregister_port(lpss->line);
if (lpss->board->exit) if (lpss->board->exit)
lpss->board->exit(lpss); lpss->board->exit(lpss);
serial8250_unregister_port(lpss->line);
} }
static const struct lpss8250_board byt_board = { static const struct lpss8250_board byt_board = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册