Skip to content

Commit 2e45676

Browse files
Madhuparna Bhowmikvinodkoul
authored andcommitted
dmaengine: pch_dma.c: Avoid data race between probe and irq handler
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent aee45db commit 2e45676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/pch_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,7 @@ static int pch_dma_probe(struct pci_dev *pdev,
865865
}
866866

867867
pci_set_master(pdev);
868+
pd->dma.dev = &pdev->dev;
868869

869870
err = request_irq(pdev->irq, pd_irq, IRQF_SHARED, DRV_NAME, pd);
870871
if (err) {
@@ -880,7 +881,6 @@ static int pch_dma_probe(struct pci_dev *pdev,
880881
goto err_free_irq;
881882
}
882883

883-
pd->dma.dev = &pdev->dev;
884884

885885
INIT_LIST_HEAD(&pd->dma.channels);
886886

0 commit comments

Comments
 (0)