]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tty: serial: pch_uart: add check for dma_alloc_coherent()
authorZhaoyang Yu <2426767509@qq.com>
Thu, 9 Apr 2026 05:41:58 +0000 (13:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 May 2026 15:02:07 +0000 (17:02 +0200)
commit6fe472c1bbbe238e91141f7cabc1226e96a60d43
tree6ddc72a92248067ecf3a02db68fa93bd63b9aff5
parentd15cd40cb1858f75846eaafa9a6bca841b790a92
tty: serial: pch_uart: add check for dma_alloc_coherent()

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.

Fixes: 3c6a483275f4 ("Serial: EG20T: add PCH_UART driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Zhaoyang Yu <2426767509@qq.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/tencent_E328416B7CFD436F6029F2DF02AD7ED89C08@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/pch_uart.c