DMA Engine development
 help / color / mirror / Atom feed
* [PATCH -next] dmaengine: ti: edma: Fix error return code in edma_probe()
@ 2019-12-12 11:46 Wei Yongjun
  2019-12-12 11:54 ` Peter Ujfalusi
  2019-12-18  6:11 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2019-12-12 11:46 UTC (permalink / raw)
  To: Dan Williams, Vinod Koul, Peter Ujfalusi, Chuhong Yuan,
	Arnd Bergmann, YueHaibing
  Cc: Wei Yongjun, dmaengine, kernel-janitors

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")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/dma/ti/edma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index 0628ee4bf1b4..03a7f647f7b2 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -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);




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] dmaengine: ti: edma: Fix error return code in edma_probe()
  2019-12-12 11:46 [PATCH -next] dmaengine: ti: edma: Fix error return code in edma_probe() Wei Yongjun
@ 2019-12-12 11:54 ` Peter Ujfalusi
  2019-12-18  6:11 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2019-12-12 11:54 UTC (permalink / raw)
  To: Wei Yongjun, Dan Williams, Vinod Koul, Chuhong Yuan,
	Arnd Bergmann, YueHaibing
  Cc: dmaengine, kernel-janitors



On 12/12/2019 13.46, Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Fixes: 2a03c1314506 ("dmaengine: ti: edma: add missed operations")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/dma/ti/edma.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index 0628ee4bf1b4..03a7f647f7b2 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -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);
> 
> 
> 

- Péter

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] dmaengine: ti: edma: Fix error return code in edma_probe()
  2019-12-12 11:46 [PATCH -next] dmaengine: ti: edma: Fix error return code in edma_probe() Wei Yongjun
  2019-12-12 11:54 ` Peter Ujfalusi
@ 2019-12-18  6:11 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2019-12-18  6:11 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Dan Williams, Peter Ujfalusi, Chuhong Yuan, Arnd Bergmann,
	YueHaibing, dmaengine, kernel-janitors

On 12-12-19, 11:46, Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-18  6:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-12 11:46 [PATCH -next] dmaengine: ti: edma: Fix error return code in edma_probe() Wei Yongjun
2019-12-12 11:54 ` Peter Ujfalusi
2019-12-18  6:11 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox