serial: 8250_port: Drop duplicate NULL check
PATCH 1/1 serial: 8250_port: Drop duplicate NULL check
serial8250_release_dma() is NULL-aware, no need to check this in the caller. While at it, make sure DMA won't be used again, by NULLifying the pointer.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/tty/serial/8250/8250_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/8250/8250_port.c +2 -2
@@ -2366,8 +2366,8 @@ void serial8250_do_shutdown(struct uart_port *port)synchronize_irq (port->irq); -if (up->dma) -serial8250_release_dma (up); +serial8250_release_dma (up); + up->dma =NULL ; scoped_guard(uart_port_lock_irqsave, port) {if (port->flags &UPF_FOURPORT ) {
Signature · 1 line
2.50.1
Quoted 14 lines · Andy Shevchenko
serial8250_release_dma()is NULL-aware, no need to check this in the caller. While at it, make sure DMA won't be used again, by NULLifying the pointer.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/tty/serial/8250/8250_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/tty/serial/8250/8250_port.c +0
-0
drivers/tty/serial/8250/8250_port.c void serial8250_do_shutdown(struct uart_port *port) · line 2373
Quoted 10 lines
drivers/tty/serial/8250/8250_port.c +2
-2@@ -2366,8 +2366,8 @@ void serial8250_do_shutdown(struct uart_port *port)synchronize_irq (port->irq); -if (up->dma) -serial8250_release_dma (up); +serial8250_release_dma (up); + up->dma =NULL ; scoped_guard(uart_port_lock_irqsave, port) {if (port->flags &UPF_FOURPORT ) {
Seems reasonable safeguard,
Reviewed-by Ilpo Järvinen <[email protected]>
Signature · 1 line
i.
Quoted 1 line · Ilpo Järvinen
On Wed, 28 Jan 2026, Andy Shevchenko wrote:
...
Quoted 6 lines
drivers/tty/serial/8250/8250_port.c void serial8250_do_shutdown(struct uart_port *port) · line 2370
Quoted 4 lines
drivers/tty/serial/8250/8250_port.c +2
-2-if (up->dma) -serial8250_release_dma (up); +serial8250_release_dma (up); + up->dma =NULL ;Seems reasonable safeguard,
Note, 8250_omap does the same for last 3 years.
Quoted 1 line
Reviewed-by Ilpo J�rvinen <[email protected]>
Thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko