diff mbox

[-next] dmaengine: edma: Fix error return code in edma_alloc_chan_resources()

Message ID 1476717395-15999-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Wei Yongjun Oct. 17, 2016, 3:16 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/dma/edma.c | 1 +
 1 file changed, 1 insertion(+)




--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Vinod Koul Oct. 18, 2016, 2:49 p.m. UTC | #1
On Mon, Oct 17, 2016 at 03:16:35PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

Applied, thanks

> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/dma/edma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 844e87b..ec478a2 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -1624,6 +1624,7 @@ static int edma_alloc_chan_resources(struct dma_chan *chan)
>  	if (echan->slot[0] < 0) {
>  		dev_err(dev, "Entry slot allocation failed for channel %u\n",
>  			EDMA_CHAN_SLOT(echan->ch_num));
> +		ret = echan->slot[0];
>  		goto err_slot;
>  	}
>  
> 
> 
>
diff mbox

Patch

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 844e87b..ec478a2 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -1624,6 +1624,7 @@  static int edma_alloc_chan_resources(struct dma_chan *chan)
 	if (echan->slot[0] < 0) {
 		dev_err(dev, "Entry slot allocation failed for channel %u\n",
 			EDMA_CHAN_SLOT(echan->ch_num));
+		ret = echan->slot[0];
 		goto err_slot;
 	}