]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: ptdma: check for null desc before calling pt_cmd_callback
authorEric Pilmore <epilmore@gigaio.com>
Fri, 10 Feb 2023 07:51:43 +0000 (23:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:39 +0000 (09:33 +0100)
commit715e822c96a5a01eea261e187fd7e72e7567b0f7
treebaab54357d7d56bcc3e6397b7b81f0d1e8e0927a
parent6c2c0204f39510b656648f12a274cbc325aa17e1
dmaengine: ptdma: check for null desc before calling pt_cmd_callback

[ Upstream commit 712e8c38dd49260a79866b3b9b36261f5c88ad92 ]

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: 2c8284681616 ("dmaengine: ptdma: fix concurrency issue with multiple dma transfer")
Signed-off-by: Eric Pilmore <epilmore@gigaio.com>
Link: https://lore.kernel.org/r/20230210075142.58253-1-epilmore@gigaio.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ptdma/ptdma-dmaengine.c