Re: [PATCH v2] tty: serial: pch_uart: add check for dma_alloc_coherent()

From: Andy Shevchenko

Date: Tue Apr 14 2026 - 13:17:21 EST


On Thu, Apr 09, 2026 at 01:41:58PM +0800, Zhaoyang Yu wrote:
> Add a check for dma_alloc_coherent() failure to prevent a potential
> NULL pointer dereference in dma_handle_rx(). Properly release DMA
> channels and the PCI device reference using a goto ladder if the
> allocation fails.

As a fix for backporting it's good enough, ideally should be converted to one
from 8250 family as it was done, for example, for Intel MID (see a history of
8250_mid.c for the details).

FWIW, the HW one may test this on is Intel Minnowboard v1 which uses EG20T PCH.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko