diff mbox series

dmaengine: ptdma: check for null desc before calling pt_cmd_callback

Message ID 20230127204451.95190-1-epilmore@gigaio.com (mailing list archive)
State Superseded
Headers show
Series dmaengine: ptdma: check for null desc before calling pt_cmd_callback | expand

Commit Message

Eric Pilmore Jan. 27, 2023, 8:44 p.m. UTC
Resolves a panic that can occur on AMD systems during host shutdown
where pt_issue_pending() could potentially call pt_cmd_callback()
with a NULL desc pointer.
Ref: Bugzilla Bug 216856.

Fixes: 6fa7e0e836e2 ("dmaengine: ptdma: fix concurrency issue with multiple dma transfer")
Signed-off-by: Eric Pilmore <epilmore@gigaio.com>
---
 drivers/dma/ptdma/ptdma-dmaengine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/dma/ptdma/ptdma-dmaengine.c b/drivers/dma/ptdma/ptdma-dmaengine.c
index cc22d162ce25..1aa65e5de0f3 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);
 }