linux-uconsole/drivers/tty/serial/8250
He Zhe 498ce67eb6 serial: 8250: Fix serial8250 initialization crash
[ Upstream commit 352c4cf40c ]

The initialization code of interrupt backoff work might reference NULL
pointer and cause the following crash, if no port was found.

[   10.017727] CPU 0 Unable to handle kernel paging request at virtual address 000001b0, epc == 807088e0, ra == 8070863c
---- snip ----
[   11.704470] [<807088e0>] serial8250_register_8250_port+0x318/0x4ac
[   11.747251] [<80708d74>] serial8250_probe+0x148/0x1c0
[   11.789301] [<80728450>] platform_drv_probe+0x40/0x94
[   11.830515] [<807264f8>] really_probe+0xf8/0x318
[   11.870876] [<80726b7c>] __driver_attach+0x110/0x12c
[   11.910960] [<80724374>] bus_for_each_dev+0x78/0xcc
[   11.951134] [<80725958>] bus_add_driver+0x200/0x234
[   11.989756] [<807273d8>] driver_register+0x84/0x148
[   12.029832] [<80d72f84>] serial8250_init+0x138/0x198
[   12.070447] [<80100e6c>] do_one_initcall+0x5c/0x2a0
[   12.110104] [<80d3a208>] kernel_init_freeable+0x370/0x484
[   12.150722] [<80a49420>] kernel_init+0x10/0xf8
[   12.191517] [<8010756c>] ret_from_kernel_thread+0x14/0x1c

This patch makes sure the initialization code can be reached only if a port
is found.

Fixes: 6d7f677a2a ("serial: 8250: Rate limit serial port rx interrupts during input overruns")
Signed-off-by: He Zhe <zhe.he@windriver.com>
Reviewed-by: Darwin Dingel <darwin.dingel@alliedtelesis.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-05 09:21:06 +01:00
..
8250.h
8250_accent.c
8250_acorn.c
8250_aspeed_vuart.c
8250_bcm2835aux.c
8250_boca.c
8250_core.c serial: 8250: Fix serial8250 initialization crash 2019-12-05 09:21:06 +01:00
8250_dma.c
8250_dw.c dmaengine: idma64: Use actual device for DMA transfers 2019-06-15 11:54:10 +02:00
8250_early.c
8250_em.c
8250_exar.c
8250_exar_st16c554.c
8250_fintek.c
8250_fourport.c
8250_fsl.c serial: 8250: Rate limit serial port rx interrupts during input overruns 2019-12-05 09:20:25 +01:00
8250_gsc.c
8250_hp300.c
8250_hub6.c
8250_ingenic.c
8250_lpc18xx.c
8250_lpss.c
8250_men_mcb.c 8250-men-mcb: fix error checking when get_num_ports returns -ENODEV 2019-11-10 11:27:25 +01:00
8250_mid.c
8250_moxa.c
8250_mtk.c
8250_of.c serial: 8250: Rate limit serial port rx interrupts during input overruns 2019-12-05 09:20:25 +01:00
8250_omap.c
8250_pci.c serial: 8250_pci: Have ACCES cards that use the four port Pericom PI7C9X7954 chip use the pci_pericom_setup() 2019-03-23 20:10:06 +01:00
8250_pnp.c
8250_port.c serial: 8250: Fix TX interrupt handling condition 2019-07-31 07:27:00 +02:00
8250_pxa.c serial: 8250_pxa: honor the port number from devicetree 2019-04-05 22:33:01 +02:00
8250_uniphier.c
Kconfig
Makefile
serial_cs.c