diff mbox series

dmaengine: mediatek: Return the correct errno code

Message ID 20210617133229.1497-1-angkery@163.com (mailing list archive)
State New, archived
Headers show
Series dmaengine: mediatek: Return the correct errno code | expand

Commit Message

Junlin Yang June 17, 2021, 1:32 p.m. UTC
From: Junlin Yang <yangjunlin@yulong.com>

When devm_kzalloc failed, should return ENOMEM rather than ENODEV.

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
---
 drivers/dma/mediatek/mtk-uart-apdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthias Brugger June 18, 2021, 1:53 p.m. UTC | #1
On 17/06/2021 15:32, angkery wrote:
> From: Junlin Yang <yangjunlin@yulong.com>
> 
> When devm_kzalloc failed, should return ENOMEM rather than ENODEV.
> 
> Signed-off-by: Junlin Yang <yangjunlin@yulong.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.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 375e7e6..a4cb30f 100644
> --- a/drivers/dma/mediatek/mtk-uart-apdma.c
> +++ b/drivers/dma/mediatek/mtk-uart-apdma.c
> @@ -529,7 +529,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;
>  		}
>  
>
Chen-Yu Tsai June 21, 2021, 5:52 a.m. UTC | #2
On Thu, Jun 17, 2021 at 9:35 PM angkery <angkery@163.com> wrote:
>
> From: Junlin Yang <yangjunlin@yulong.com>
>
> When devm_kzalloc failed, should return ENOMEM rather than ENODEV.
>
> Signed-off-by: Junlin Yang <yangjunlin@yulong.com>

Please add proper fixes tags:

Fixes: 9135408c3ace ("dmaengine: mediatek: Add MediaTek UART APDMA support")
diff mbox series

Patch

diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c
index 375e7e6..a4cb30f 100644
--- a/drivers/dma/mediatek/mtk-uart-apdma.c
+++ b/drivers/dma/mediatek/mtk-uart-apdma.c
@@ -529,7 +529,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;
 		}