OpenCloudOS-Kernel/drivers/tty/serial/8250
Andy Shevchenko 7c3e8d9df2 serial: 8250_exar: Avoid NULL pointer dereference at ->exit()
It's possible that during ->exit() the private_data is NULL,
for instance when there was no GPIO device instantiated.
Due to this we may not dereference it. Add a respective check.

Note, for now ->exit() only makes sense when GPIO device
was instantiated, that's why we may use the check for entire
function.

Fixes: 81171e7d31 ("serial: 8250_exar: Constify the software nodes")
Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20210608144239.12697-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-09 14:40:48 +02:00
..
8250.h serial: 8250: Use BIT(x) for UART_{CAP,BUG}_* 2021-05-20 17:14:50 +02:00
8250_accent.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_acorn.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_aspeed_vuart.c serial: 8250: Add UART_BUG_TXRACE workaround for Aspeed VUART 2021-05-20 17:14:46 +02:00
8250_bcm2835aux.c serial: 8250: Simplify with dev_err_probe() 2020-09-04 17:14:29 +02:00
8250_bcm7271.c serial: 8250: Make symbol 'brcmuart_debugfs_root' static 2021-04-02 16:12:27 +02:00
8250_boca.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_core.c serial: 8250: fix null-ptr-deref in serial8250_start_tx() 2020-07-21 21:23:18 +02:00
8250_dma.c serial: 8250: factor out serial8250_{set,clear}_THRI() helpers 2019-06-18 09:36:55 +02:00
8250_dw.c serial: 8250_dw: Add device HID for new AMD UART controller 2021-05-13 17:08:42 +02:00
8250_dwlib.c serial: 8250_dw: split Synopsys DesignWare 8250 common functions 2019-09-04 12:43:52 +02:00
8250_dwlib.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
8250_early.c tty: serial: 8250: 8250_port: Move prototypes to shared location 2020-11-13 15:28:12 +01:00
8250_em.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8250_exar.c serial: 8250_exar: Avoid NULL pointer dereference at ->exit() 2021-06-09 14:40:48 +02:00
8250_exar_st16c554.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fintek.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8250_fourport.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fsl.c serial: do not restore interrupt state in sysrq helper 2021-04-22 12:04:26 +02:00
8250_gsc.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
8250_hp300.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
8250_hub6.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_ingenic.c serial: 8250: Simplify with dev_err_probe() 2020-09-04 17:14:29 +02:00
8250_ioc3.c Fix up remaining devm_ioremap_nocache() in SGI IOC3 8250 UART driver 2020-02-08 14:19:39 -08:00
8250_lpc18xx.c tty: Remove dev_err() usage after platform_get_irq() 2019-09-04 12:43:49 +02:00
8250_lpss.c serial: 8250_lpss: Add ->setup() for Elkhart Lake ports 2020-03-06 13:31:19 +01:00
8250_men_mcb.c 8250-men-mcb: fix signed/unsigned confusion 2020-06-27 16:12:45 +02:00
8250_mid.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_mtk.c serial: 8250-mtk: Fix reference leak in mtk8250_probe 2020-11-26 21:19:58 +01:00
8250_of.c serial: 8250_of: Add nuvoton,wpcm450-uart 2021-03-28 14:11:31 +02:00
8250_omap.c Revert "serial: 8250: 8250_omap: Fix possible interrupt storm" 2021-05-28 10:58:49 +02:00
8250_pci.c serial: 8250_pci: handle FL_NOIRQ board flag 2021-05-27 15:22:36 +02:00
8250_pnp.c serial: 8250_pnp: Move to struct dev_pm_ops 2019-09-04 12:43:46 +02:00
8250_port.c serial: 8250: Add UART_BUG_TXRACE workaround for Aspeed VUART 2021-05-20 17:14:46 +02:00
8250_pxa.c serial: 8250_pxa: Switch to use platform_get_irq() 2020-06-27 16:12:56 +02:00
8250_tegra.c 8250_tegra: clean up tegra_uart_handle_break 2021-01-07 16:17:31 +01:00
8250_uniphier.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
Kconfig serial: extend compile-test coverage 2021-04-22 13:12:13 +02:00
Makefile serial: 8250: Add new 8250-core based Broadcom STB driver 2021-03-26 15:18:30 +01:00
serial_cs.c tty: 8250/serial_cs, propagate errors in simple_config 2021-03-10 09:34:07 +01:00