From: Axel Lin Date: Sun, 28 Jun 2015 01:45:08 +0000 (+0800) Subject: serial: etraxfs-uart: Fix release etraxfs_uart_ports X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d8c2c0d89205a3538c5fd77dc9d4767ee6bebc70;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git serial: etraxfs-uart: Fix release etraxfs_uart_ports In probe, we use dev_id as array index of etraxfs_uart_ports and store the index in port->line. So etraxfs_uart_ports[port->line] should be released when unload the module. Signed-off-by: Axel Lin Acked-by: Niklas Cassel Acked-by: Jesper Nilsson Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/etraxfs-uart.c b/drivers/tty/serial/etraxfs-uart.c index a57301a6fe42..679709f51fd4 100644 --- a/drivers/tty/serial/etraxfs-uart.c +++ b/drivers/tty/serial/etraxfs-uart.c @@ -950,7 +950,7 @@ static int etraxfs_uart_remove(struct platform_device *pdev) port = platform_get_drvdata(pdev); uart_remove_one_port(&etraxfs_uart_driver, port); - etraxfs_uart_ports[pdev->id] = NULL; + etraxfs_uart_ports[port->line] = NULL; return 0; }