Patch "dmaengine: at_hdmac: check return value of of_find_device_by_node() in at_dma_xlate()" has been added to the 4.19-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: at_hdmac: check return value of of_find_device_by_node() in at_dma_xlate()

to the 4.19-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-at_hdmac-check-return-value-of-of_find_dev.patch
and it can be found in the queue-4.19 subdirectory.

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



commit c0a16d1fcda04c7680bb37fa689d0a697649e99e
Author: Yu Kuai <yukuai3@xxxxxxxxxx>
Date:   Mon Aug 17 19:57:26 2020 +0800

    dmaengine: at_hdmac: check return value of of_find_device_by_node() in at_dma_xlate()
    
    [ Upstream commit 0cef8e2c5a07d482ec907249dbd6687e8697677f ]
    
    The reurn value of of_find_device_by_node() is not checked, thus null
    pointer dereference will be triggered if of_find_device_by_node()
    failed.
    
    Fixes: bbe89c8e3d59 ("at_hdmac: move to generic DMA binding")
    Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200817115728.1706719-2-yukuai3@xxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index dbc51154f1229..86427f6ba78cb 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1677,6 +1677,8 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
 		return NULL;
 
 	dmac_pdev = of_find_device_by_node(dma_spec->np);
+	if (!dmac_pdev)
+		return NULL;
 
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);



[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