Skip to content

Commit 9284699

Browse files
epilmorevinodkoul
authored andcommitted
dmaengine: ptdma: check for null desc before calling pt_cmd_callback
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: 6fa7e0e ("dmaengine: ptdma: fix concurrency issue with multiple dma transfer") Signed-off-by: Eric Pilmore <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent be4d46e commit 9284699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/ptdma/ptdma-dmaengine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static void pt_issue_pending(struct dma_chan *dma_chan)
254254
spin_unlock_irqrestore(&chan->vc.lock, flags);
255255

256256
/* If there was nothing active, start processing */
257-
if (engine_is_idle)
257+
if (engine_is_idle && desc)
258258
pt_cmd_callback(desc, 0);
259259
}
260260

0 commit comments

Comments
 (0)