Skip to contentSkip to conversation

dmaengine: ti: edma: Fix error return code in edma_probe()

PATCH Applied Wei Yongjun 3 participants 3 messages Dec 12, 2019 – Dec 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: ti: edma: Fix error return code in edma_probe()

Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.

Fixes 2a03c1314506 ("dmaengine: ti: edma: add missed operations")
---
 drivers/dma/ti/edma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/ti/edma.c +3 -1
index 0628ee4bf1b4..03a7f647f7b2 100644
@@ -2342,8 +2342,10 @@ static int edma_probe(struct platform_device *pdev)
 	ecc->channels_mask = devm_kcalloc(dev,
 					   BITS_TO_LONGS(ecc->num_channels),
 					   sizeof(unsigned long), GFP_KERNEL);
-	if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask)
+	if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask) {
+		ret = -ENOMEM;
 		goto err_disable_pm;
+	}
 
 	/* Mark all channels available initially */
 	bitmap_fill(ecc->channels_mask, ecc->num_channels);
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Wei Yongjun

Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.

Quoted 16 lines
Fixes 2a03c1314506 ("dmaengine: ti: edma: add missed operations")
---
 drivers/dma/ti/edma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/ti/edma.c +0 -0
index 0628ee4bf1b4..03a7f647f7b2 100644
@@ -2342,8 +2342,10 @@ static int edma_probe(struct platform_device *pdev)
 	ecc->channels_mask = devm_kcalloc(dev,

drivers/dma/ti/edma.c static int edma_probe(struct platform_device *pdev) · line 2351

Quoted 10 lines
drivers/dma/ti/edma.c +3 -1
 					   BITS_TO_LONGS(ecc->num_channels),
 					   sizeof(unsigned long), GFP_KERNEL);
-	if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask)
+	if (!ecc->slave_chans || !ecc->slot_inuse || !ecc->channels_mask) {
+		ret = -ENOMEM;
 		goto err_disable_pm;
+	}
 
 	/* Mark all channels available initially */
 	bitmap_fill(ecc->channels_mask, ecc->num_channels);

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

maintainer Applied
#2 lore raw
In reply to Wei Yongjun
Quoted 2 lines · Wei Yongjun

Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.

Applied, thanks

Signature · 1 line
~Vinod