linux-stable/drivers/tty/serial
Tony Lindgren 6be1a8d50b serial: core: Fix kmemleak issue for serial core device remove
Kmemleak reports issues for serial8250 ports after the hardware specific
driver takes over on boot as noted by Tomi.

The kerneldoc for device_initialize() says we must call device_put()
after calling device_initialize(). We are calling device_put() on the
error path, but are missing it from the device remove path. This causes
release() to never get called for the devices on remove.

Let's add the missing put_device() calls for both serial ctrl and
port devices.

Fixes: 84a9582fd2 ("serial: core: Start managing serial controllers to enable runtime PM")
Reported-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20230804090909.51529-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-04 15:11:36 +02:00
..
8250 serial: core: Fix serial core port id to not use port->line 2023-08-01 07:48:55 +02:00
cpm_uart Merge 6.4-rc5 into tty-next 2023-06-05 07:41:04 +02:00
jsm drivers: serial: jsm: fix some leaks in probe 2022-09-22 16:11:43 +02:00
21285.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
altera_jtaguart.c tty: serial: altera_jtaguart: remove struct altera_jtaguart 2022-11-22 17:51:42 +01:00
altera_uart.c serial: altera_uart: fix locking in polling mode 2022-11-23 09:38:42 +01:00
amba-pl010.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
amba-pl011.c serial: pl011: set UART011_CR_RXE in pl011_set_termios after port shutdown 2023-05-13 19:32:21 +09:00
apbuart.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
apbuart.h
ar933x_uart.c serial: ar933x: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
arc_uart.c serial: arc_uart: fix of_iomap leak in arc_serial_probe 2023-05-13 19:55:46 +09:00
atmel_serial.c serial: atmel: don't enable IRQs prematurely 2023-06-21 17:54:33 +02:00
atmel_serial.h tty: serial: atmel: Use FIELD_PREP/FIELD_GET 2022-09-22 16:32:25 +02:00
bcm63xx_uart.c serial: bcm63xx-uart: add polling support 2023-03-29 10:54:23 +02:00
clps711x.c serial: Make uart_remove_one_port() return void 2023-05-13 19:48:16 +09:00
digicolor-usart.c serial: digicolor: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
dz.c serial: dz: Use uart_xmit_advance() 2022-11-03 03:35:40 +01:00
dz.h
earlycon-riscv-sbi.c
earlycon-semihost.c serial: Rename earlycon semihost driver 2023-01-19 14:58:19 +01:00
earlycon.c earlycon: Let users set the clock frequency 2023-01-19 14:56:44 +01:00
fsl_linflexuart.c serial: linflexuart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
fsl_lpuart.c tty: serial: fsl_lpuart: Clear the error flags by writing 1 for lpuart32 platforms 2023-08-01 07:31:53 +02:00
icom.c serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
imx.c tty: serial: imx: fix rs485 rx after tx 2023-06-19 15:41:13 +02:00
imx_earlycon.c
ip22zilog.c serial: ip22zilog: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
ip22zilog.h
Kconfig TTY/Serial driver updates for 6.5-rc1. 2023-07-03 13:14:58 -07:00
kgdb_nmi.c
kgdboc.c tty: serial: kgdboc: fix mutex locking order for configure_kgdboc() 2023-01-16 16:44:53 +01:00
lantiq.c TTY/Serial driver updates for 6.5-rc1. 2023-07-03 13:14:58 -07:00
liteuart.c serial: liteuart: Remove a copy of UART id in private structure 2023-01-31 10:59:48 +01:00
lpc32xx_hs.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
ma35d1_serial.c tty: serial: Add Nuvoton ma35d1 serial driver support 2023-06-19 15:42:26 +02:00
Makefile tty: serial: Add Nuvoton ma35d1 serial driver support 2023-06-19 15:42:26 +02:00
max310x.c serial: Switch i2c drivers back to use .probe() 2023-05-30 11:46:05 +01:00
max3100.c serial: Make uart_handle_cts_change() status param bool active 2023-01-19 16:04:35 +01:00
mcf.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
men_z135_uart.c serial: men_z135_uart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
meson_uart.c tty: serial: meson: Add a new compatible string for the G12A SoC 2023-03-09 17:21:02 +01:00
milbeaut_usio.c serial: milbeaut_usio: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
mpc52xx_uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
mps2-uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
msm_serial.c serial: msm: add lock annotation to msm_set_baud_rate() 2023-01-19 15:53:09 +01:00
mux.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
mvebu-uart.c serial: mvebu-uart: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
mxs-auart.c serial: Use of_property_read_bool() for boolean properties 2023-03-16 13:02:14 +01:00
omap-serial.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
owl-uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
pch_uart.c tty: pcn_uart: fix memory leak with using debugfs_lookup() 2023-02-08 13:09:55 +01:00
pic32_uart.c serial: pic32: Add checks for devm_clk_get() in pic32_uart_probe() 2023-01-19 16:02:23 +01:00
pmac_zilog.c serial: pmac_zilog: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
pmac_zilog.h
pxa.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
qcom_geni_serial.c serial: qcom-geni: drop bogus runtime pm state update 2023-07-24 09:51:51 +02:00
rda-uart.c serial: rda: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
rp2.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
sa1100.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
samsung_tty.c tty: serial: samsung_tty: Use abs() to simplify some code 2023-06-13 12:33:22 +02:00
sb1250-duart.c serial: sb1250-duart: clean up after SIBYTE_BCM1x55 removal 2023-03-29 10:54:39 +02:00
sc16is7xx.c serial: Switch i2c drivers back to use .probe() 2023-05-30 11:46:05 +01:00
sccnxp.c serial: sccnxp: Use devm_clk_get_enabled() helper 2023-01-19 15:51:28 +01:00
serial-tegra.c serial: tegra: Add missing clk_disable_unprepare() in tegra_uart_hw_init() 2023-01-19 15:54:01 +01:00
serial_base.h serial: core: Start managing serial controllers to enable runtime PM 2023-05-31 10:46:59 +01:00
serial_base_bus.c serial: core: Fix kmemleak issue for serial core device remove 2023-08-04 15:11:36 +02:00
serial_core.c serial: core: Fix error handling for serial_core_ctrl_device_add() 2023-06-02 08:30:55 +01:00
serial_ctrl.c serial: core: Start managing serial controllers to enable runtime PM 2023-05-31 10:46:59 +01:00
serial_mctrl_gpio.c
serial_mctrl_gpio.h
serial_port.c serial: core: Start managing serial controllers to enable runtime PM 2023-05-31 10:46:59 +01:00
serial_txx9.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
sh-sci.c tty: serial: sh-sci: Fix sleeping in atomic context 2023-07-25 20:30:20 +02:00
sh-sci.h tty: serial: sh-sci: Add support for tx end interrupt handling 2023-04-20 13:47:33 +02:00
sifive.c serial: sifive: Fix sifive_serial_console_setup() section 2023-07-25 20:30:02 +02:00
sprd_serial.c serial: sprd: Drop of_match_ptr for ID table 2023-03-16 13:02:17 +01:00
st-asc.c serial: st-asc: fix typo in property name 2023-06-06 14:42:58 +02:00
stm32-usart.c serial: stm32: Ignore return value of uart_remove_one_port() in .remove() 2023-05-13 19:48:16 +09:00
stm32-usart.h serial: stm32: Remove unused struct stm32_port txdone element 2023-03-09 17:16:11 +01:00
suncore.c
sunhv.c tty/serial: Make ->dcd_change()+uart_handle_dcd_change() status bool active 2023-01-19 16:04:35 +01:00
sunplus-uart.c serial: sunplus-uart: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
sunsab.c serial: sunsab: Fix error handling in sunsab_init() 2022-11-23 09:38:50 +01:00
sunsab.h
sunsu.c serial: sunsu: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
sunzilog.c serial: Use of_property_present() for testing DT property presence 2023-03-16 13:02:11 +01:00
sunzilog.h
tegra-tcu.c Merge 7e2cd21e02 ("Merge tag 'tty-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") into tty-next 2022-09-25 09:22:13 +02:00
timbuart.c serial: timbuart: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
timbuart.h
uartlite.c serial: Make uart_remove_one_port() return void 2023-05-13 19:48:16 +09:00
ucc_uart.c Documentation: devices.txt: reconcile serial/ucc_uart minor numers 2023-07-25 19:29:23 +02:00
vt8500_serial.c serial: Fix a typo ("ignorning") 2022-11-09 13:03:12 +01:00
xilinx_uartps.c serial: Make uart_remove_one_port() return void 2023-05-13 19:48:16 +09:00
zs.c serial: zs: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
zs.h