Re: [PATCH v1 1/1] serial: 8250_port: Drop duplicate NULL check

From: Jiri Slaby

Date: Tue Mar 03 2026 - 00:25:43 EST


On 02. 03. 26, 16:27, Andy Shevchenko wrote:
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@xxxxxxxxxxxxxxx>
---
drivers/tty/serial/8250/8250_port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index d99c5ad7e47c..2a830969d22b 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -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;

Shouldn't serial8250_release_dma() NULL it instead, so the callers need not to bother?

thanks,
--
js
suse labs