linux/drivers/tty/serial/8250
Jiangshan Yi 7fb13fd7e9 serial: 8250_mid: Fix NULL function pointer dereference on DNV/ICX-D/SNR platforms
Commit b1b4efea05 ("serial: 8250_mid: Disable DMA for selected
platforms") replaced the dnv_board setup and exit callbacks with
PTR_IF(false, ...), which evaluates to NULL. However, the three call
sites in mid8250_probe() and mid8250_remove() unconditionally
dereference these function pointers without NULL checks, causing a NULL
pointer dereference (kernel oops) on any Denverton (DNV), Ice Lake Xeon
D (ICX-D/CDF), or Snowridge (SNR) platform.

Fix this by adding the missing NULL checks before calling the setup and
exit callbacks.

Fixes: b1b4efea05 ("serial: 8250_mid: Disable DMA for selected platforms")
Cc: stable <stable@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
Link: https://patch.msgid.link/20260715073546.1875083-1-yijiangshan@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-17 13:07:04 +02:00
..
8250_accent.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_acorn.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
8250_aspeed_vuart.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
8250_bcm2835aux.c serial: 8250: Provide flag for IER toggling for RS485 2025-01-10 16:08:25 +01:00
8250_bcm7271.c serial: 8250: Switch to use hrtimer_setup() 2025-02-20 15:38:28 +01:00
8250_boca.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_ce4100.c serial: 8520_ce4100: Reuse mem_serial_in() in ce4100_mem_serial_in() 2025-07-09 13:44:50 +02:00
8250_core.c serial: 8250: Add support for console flow control 2026-05-22 11:45:41 +02:00
8250_dfl.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
8250_dma.c serial: 8250: Fix TX deadlock when using DMA 2026-03-12 15:29:59 +01:00
8250_dw.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
8250_dwlib.c serial: 8250_dwlib: move DesignWare register definitions to header 2026-05-11 17:00:42 +02:00
8250_dwlib.h serial: 8250_dw: build Renesas RZN1 CPR value from DW_UART_CPR_* definitions 2026-05-11 17:00:42 +02:00
8250_early.c serial: switch uart_port::iotype to enum uart_iotype 2025-04-25 13:46:31 +02:00
8250_em.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
8250_exar_st16c554.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_exar.c Merge 6.18-rc3 into tty-next 2025-10-27 08:17:40 +01:00
8250_fintek.c serial: 8250_fintek: Add support for F81214E 2026-03-30 17:36:09 +02:00
8250_fourport.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fsl.c serial: 8250: use serial_port_in/out() helpers 2025-03-20 08:00:52 -07:00
8250_hp300.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
8250_hub6.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_ingenic.c serial: 8250: sanitize uart_port::serial_{in,out}() types 2025-06-17 13:42:34 +02:00
8250_ioc3.c DT updates for ralink, mobileye and ralink 2025-07-31 11:08:55 -07:00
8250_keba.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
8250_loongson.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
8250_lpc18xx.c serial: 8250: sanitize uart_port::serial_{in,out}() types 2025-06-17 13:42:34 +02:00
8250_lpss.c serial: 8250_lpss: copy dma_param using devm_kmemdup() 2024-01-04 16:21:51 +01:00
8250_men_mcb.c 8250_men_mcb: drop unneeded MODULE_ALIAS 2026-01-16 14:25:05 +01:00
8250_mid.c serial: 8250_mid: Fix NULL function pointer dereference on DNV/ICX-D/SNR platforms 2026-07-17 13:07:04 +02:00
8250_mtk.c serial: 8250_mtk: Add ACPI support 2026-05-11 16:55:18 +02:00
8250_ni.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
8250_of.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
8250_omap.c serial: 8250_omap: clear rx_running on zero-length DMA completes 2026-07-10 14:46:54 +02:00
8250_parisc.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
8250_pci.c serial: 8250_pci: Don't specify conflicting values to pci_device_id members 2026-06-12 11:55:41 +02:00
8250_pci1xxxx.c serial: 8250_pcilib: Replace deprecated PCI functions 2025-10-22 12:06:53 +02:00
8250_pcilib.c serial: 8250_pcilib: Replace deprecated PCI functions 2025-10-22 12:06:53 +02:00
8250_pcilib.h serial: 8250_pcilib: Replace deprecated PCI functions 2025-10-22 12:06:53 +02:00
8250_pericom.c serial: 8250_pericom: Use UART_LCR_DLAB 2022-06-27 14:33:15 +02:00
8250_platform.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
8250_pnp.c serial: 8250_pnp: Remove unneeded ->iotype assignment 2025-02-04 14:44:53 +01:00
8250_port.c serial: 8250: Ignore flow control on suspend/resume with no_console_suspend 2026-07-10 14:47:30 +02:00
8250_pxa.c serial: Switch back to struct platform_driver::remove() 2024-10-11 08:13:28 +02:00
8250_rsa.c TTY/Serial changes for 6.19-rc1 2025-12-06 18:38:19 -08:00
8250_rt288x.c serial: 8250: sanitize uart_port::serial_{in,out}() types 2025-06-17 13:42:34 +02:00
8250_tegra.c serial: Switch back to struct platform_driver::remove() 2024-10-11 08:13:28 +02:00
8250_uniphier.c serial: 8250: sanitize uart_port::serial_{in,out}() types 2025-06-17 13:42:34 +02:00
8250.h serial: 8250_dw: Ensure BUSY is deasserted 2026-03-12 15:34:29 +01:00
Kconfig serial: 8250: loongson: Enable building on MIPS Loongson64 2026-03-30 17:36:20 +02:00
Makefile TTY/Serial changes for 6.19-rc1 2025-12-06 18:38:19 -08:00
serial_cs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00