dmaengine: pch_dma.c: Avoid data race between probe and irq handler
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Thu, 16 Apr 2020 06:23:35 +0000 (11:53 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:15:34 +0000 (08:15 +0200)
commit87b49639e11c13dac42d3a2fdd85fc0a0d35143c
treef7a59d9c4c7969cc4f55594cb500209a307535f0
parentf0fff9a77e8aa241f9ad7270e6bf8f1502dd3a19
dmaengine: pch_dma.c: Avoid data race between probe and irq handler

[ Upstream commit 2e45676a4d33af47259fa186ea039122ce263ba9 ]

pd->dma.dev is read in irq handler pd_irq().
However, it is set to pdev->dev after request_irq().
Therefore, set pd->dma.dev to pdev->dev before request_irq() to
avoid data race between pch_dma_probe() and pd_irq().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Link: https://lore.kernel.org/r/20200416062335.29223-1-madhuparnabhowmik10@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/pch_dma.c