PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 14 Dec 2023 06:33:28 +0000 (12:03 +0530)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 15 Dec 2023 10:59:29 +0000 (16:29 +0530)
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: 7b99aaaddabb ("PCI: epf-mhi: Add eDMA support")
Reviewed-by: Krzysztof WilczyƄski <kw@linux.com>
Link: https://lore.kernel.org/r/20231214063328.40657-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/endpoint/functions/pci-epf-mhi.c

index 472bc489b754b8e303d3d798d286b3c8b2b0a0ea..d3d6a1054036bb909d584f50b7d11870a821fc90 100644 (file)
@@ -424,7 +424,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);