Patch "dmaengine: of-dma: Fix of_dma_router_xlate's of_dma_xlate handling" has been added to the 5.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dmaengine: of-dma: Fix of_dma_router_xlate's of_dma_xlate handling

to the 5.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dmaengine-of-dma-fix-of_dma_router_xlate-s-of_dma_xl.patch
and it can be found in the queue-5.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 859f393a4f301cecfcd4c76da22089bc9cba9ed7
Author: Peter Ujfalusi <peter.ujfalusi@xxxxxx>
Date:   Thu Aug 6 13:49:28 2020 +0300

    dmaengine: of-dma: Fix of_dma_router_xlate's of_dma_xlate handling
    
    [ Upstream commit 5b2aa9f918f6837ae943557f8cec02c34fcf80e7 ]
    
    of_dma_xlate callback can return ERR_PTR as well NULL in case of failure.
    
    If error code is returned (not NULL) then the route should be released and
    the router should not be registered for the channel.
    
    Fixes: 56f13c0d9524c ("dmaengine: of_dma: Support for DMA routers")
    Signed-off-by: Peter Ujfalusi <peter.ujfalusi@xxxxxx>
    Link: https://lore.kernel.org/r/20200806104928.25975-1-peter.ujfalusi@xxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index b2c2b5e8093cf..0db816eb8080d 100644
--- a/drivers/dma/of-dma.c
+++ b/drivers/dma/of-dma.c
@@ -71,12 +71,12 @@ static struct dma_chan *of_dma_router_xlate(struct of_phandle_args *dma_spec,
 		return NULL;
 
 	chan = ofdma_target->of_dma_xlate(&dma_spec_target, ofdma_target);
-	if (chan) {
-		chan->router = ofdma->dma_router;
-		chan->route_data = route_data;
-	} else {
+	if (IS_ERR_OR_NULL(chan)) {
 		ofdma->dma_router->route_free(ofdma->dma_router->dev,
 					      route_data);
+	} else {
+		chan->router = ofdma->dma_router;
+		chan->route_data = route_data;
 	}
 
 	/*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux