OSDN Git Service

dmaengine: stm32-dma: Fix null pointer dereference in stm32_dma_tx_status
authorM'boumba Cedric Madianga <cedric.madianga@gmail.com>
Tue, 13 Dec 2016 13:40:46 +0000 (14:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Dec 2017 21:01:50 +0000 (22:01 +0100)
commit7468e767d8f2115427f2066203e5262f5dee8c5c
treec58cc4bc56a8f5e195df643c494ffb74fc9ddb07
parent000e7180633f254aef401a8cbca7f470ead41fed
dmaengine: stm32-dma: Fix null pointer dereference in stm32_dma_tx_status

[ Upstream commit 57b5a32135c813f2ab669039fb4ec16b30cb3305 ]

chan->desc is always set to NULL when a DMA transfer is complete.
As a DMA transfer could be complete during the call of stm32_dma_tx_status,
we need to be sure that chan->desc is not NULL before using this variable
to avoid a null pointer deference issue.

Signed-off-by: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
Reviewed-by: Ludovic BARRE <ludovic.barre@st.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
drivers/dma/stm32-dma.c