Skip to content

Commit

Permalink
PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()
Browse files Browse the repository at this point in the history
[ Upstream commit 327ec5f ]

In the error path of pci_epf_mhi_edma_write() function, the DMA data
direction passed (DMA_FROM_DEVICE) doesn't match the actual direction used
for the data transfer. Fix it by passing the correct one (DMA_TO_DEVICE).

Fixes: 7b99aaa ("PCI: epf-mhi: Add eDMA support")
Reviewed-by: Krzysztof Wilczyński <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Manivannan Sadhasivam <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Mani-Sadhasivam authored and gregkh committed Jan 25, 2024
1 parent ad671df commit 96227df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/endpoint/functions/pci-epf-mhi.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl,
}

err_unmap:
dma_unmap_single(dma_dev, src_addr, buf_info->size, DMA_FROM_DEVICE);
dma_unmap_single(dma_dev, src_addr, buf_info->size, DMA_TO_DEVICE);
err_unlock:
mutex_unlock(&epf_mhi->lock);

Expand Down

0 comments on commit 96227df

Please sign in to comment.