]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
serial: altera_jtaguart: handle uart_add_one_port() failures
authorMyeonghun Pak <mhun512@gmail.com>
Tue, 12 May 2026 06:56:57 +0000 (15:56 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 May 2026 09:48:23 +0000 (11:48 +0200)
commitea66be25f0e934f49d24cd0c5845d13cdba3520b
tree7b903412253da91f421681f7699a6b709a413490
parent452d6fa37ae9b021f4f6d397dbae077f7296f6f4
serial: altera_jtaguart: handle uart_add_one_port() failures

altera_jtaguart_probe() maps the register window before registering the
UART port, but it ignores failures from uart_add_one_port(). If port
registration fails, probe still returns success and the mapping remains
live until a later remove path that is not part of probe failure cleanup.

Return the uart_add_one_port() error and unmap the register window on
that failure path.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 5bcd601049c6 ("serial: Add driver for the Altera JTAG UART")
Cc: stable <stable@kernel.org>
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260512065837.79528-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/altera_jtaguart.c