Patch "dmaengine: ptdma: check for null desc before calling pt_cmd_callback" has been added to the 6.1-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: ptdma: check for null desc before calling pt_cmd_callback

to the 6.1-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-ptdma-check-for-null-desc-before-calling-p.patch
and it can be found in the queue-6.1 subdirectory.

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



commit c39a81e4e2dfc4983153f1165eec3e771b565d4e
Author: Eric Pilmore <epilmore@xxxxxxxxxx>
Date:   Thu Feb 9 23:51:43 2023 -0800

    dmaengine: ptdma: check for null desc before calling pt_cmd_callback
    
    [ Upstream commit 928469986171a6f763b34b039427f5667ba3fd50 ]
    
    Resolves a panic that can occur on AMD systems, typically during host
    shutdown, after the PTDMA driver had been exercised. The issue was
    the pt_issue_pending() function is mistakenly assuming that there will
    be at least one descriptor in the Submitted queue when the function
    is called. However, it is possible that both the Submitted and Issued
    queues could be empty, which could result in pt_cmd_callback() being
    mistakenly called with a NULL pointer.
    Ref: Bugzilla Bug 216856.
    
    Fixes: 6fa7e0e836e2 ("dmaengine: ptdma: fix concurrency issue with multiple dma transfer")
    Signed-off-by: Eric Pilmore <epilmore@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230210075142.58253-1-epilmore@xxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/ptdma/ptdma-dmaengine.c b/drivers/dma/ptdma/ptdma-dmaengine.c
index cc22d162ce250..1aa65e5de0f3a 100644
--- a/drivers/dma/ptdma/ptdma-dmaengine.c
+++ b/drivers/dma/ptdma/ptdma-dmaengine.c
@@ -254,7 +254,7 @@ static void pt_issue_pending(struct dma_chan *dma_chan)
 	spin_unlock_irqrestore(&chan->vc.lock, flags);
 
 	/* If there was nothing active, start processing */
-	if (engine_is_idle)
+	if (engine_is_idle && desc)
 		pt_cmd_callback(desc, 0);
 }
 



[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