]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: 8250_port: Drop duplicate NULL check
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 28 Jan 2026 14:27:26 +0000 (15:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2026 14:05:25 +0000 (15:05 +0100)
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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20260128142726.128175-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c

index cc94af2d578a64de54ec64a2abbf5cabed3f0b20..c05a6df8d6b4ed61115621b7264f591314b713ca 100644 (file)
@@ -2364,8 +2364,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) {