[PATCH] dmaengine: mediatek: mtk-uart-apdma: Return -ENOMEM on memory allocation failure

Frank Li Frank.li at oss.nxp.com
Wed Jul 1 20:50:38 PDT 2026


On Wed, Jul 01, 2026 at 11:07:03PM +0300, Vladimir Zapolskiy wrote:
>
> If dynamic memory allocation in driver's probe function execution fails, it
> should be reported to the driver's framework with -ENOMEM error code.
>
> Fixes: 9135408c3ace ("dmaengine: mediatek: Add MediaTek UART APDMA support")
> Signed-off-by: Vladimir Zapolskiy <vz at kernel.org>
> ---

Reviewed-by: Frank Li <Frank.Li at nxp.com>

>  drivers/dma/mediatek/mtk-uart-apdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c
> index c269d84d7bd2..f74e9a328588 100644
> --- a/drivers/dma/mediatek/mtk-uart-apdma.c
> +++ b/drivers/dma/mediatek/mtk-uart-apdma.c
> @@ -531,7 +531,7 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev)
>         for (i = 0; i < mtkd->dma_requests; i++) {
>                 c = devm_kzalloc(mtkd->ddev.dev, sizeof(*c), GFP_KERNEL);
>                 if (!c) {
> -                       rc = -ENODEV;
> +                       rc = -ENOMEM;
>                         goto err_no_dma;
>                 }
>
> --
> 2.51.0
>



More information about the linux-arm-kernel mailing list