Skip to contentSkip to conversation

dmaengine: mediatek: Return the correct errno code

PATCH In review angkery 3 participants 3 messages Jun 17, 2021 – Jun 21, 2021

Subsystems (3)
lore
Share & tools
lore

angkery

author
#0 lore raw

PATCH 1/1 dmaengine: mediatek: Return the correct errno code

From: Junlin Yang <[email protected]>

When devm_kzalloc failed, should return ENOMEM rather than ENODEV.

---
 drivers/dma/mediatek/mtk-uart-apdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/mediatek/mtk-uart-apdma.c +1 -1
index 375e7e6..a4cb30f 100644
@@ -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;
 		}
 
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · angkery

From: Junlin Yang <[email protected]>

When devm_kzalloc failed, should return ENOMEM rather than ENODEV.

Quoted 18 lines
---
 drivers/dma/mediatek/mtk-uart-apdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/mediatek/mtk-uart-apdma.c +1 -1
index 375e7e6..a4cb30f 100644
@@ -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;
 		}