[PATCH 0/3] serial: 8250_mxpcie: probe and console fixes
Linmao Li <[email protected]>
| Newsgroups | gmane.linux.serial,gmane.linux.kernel |
|---|---|
| Message-ID | <[email protected]> |
Three fixes for the Moxa PCIe serial driver, found by reading the code that was split out of 8250_pci.c and extended during this cycle. The driver is not in mainline yet, so the series is against tty-next. Patch 1 fixes a NULL pointer dereference during probe on the boards without RS232 support: the serial core calls ->rs485_config() from within serial8250_register_8250_port(), which happens before pci_set_drvdata() has published the board. Patch 2 makes the probe fail when a port cannot be registered. Today it returns success, and removal then unregisters ports that were never registered: line 0 for the entries the loop did not reach, and a negative line number for the one that failed. Patch 3 stops set_termios() from dereferencing port->state->port.tty, which is NULL when the serial core sets the line up for a console or for kgdboc. I have no Moxa board here, so the series is compile-tested only: W=1 allmodconfig build of drivers/tty/serial/8250/ and checkpatch --strict, both clean. Linmao Li (3): serial: 8250_mxpcie: set the driver data before registering ports serial: 8250_mxpcie: fail the probe when a port cannot be registered serial: 8250_mxpcie: take the line settings from the new termios drivers/tty/serial/8250/8250_mxpcie.c | 34 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 14 deletions(-) base-commit: 8b0b29fdcb47907ae0296b8fe829e918e05e300f -- 2.25.1