summaryrefslogtreecommitdiff
path: root/drivers/i3c/master
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@linux.intel.com>2023-09-21 08:57:01 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2023-09-26 00:35:14 +0300
commitb8806e0c939f168237593af0056c309bf31022b0 (patch)
treeb04e514a065b0142f5b6cdcdbe34bfa9a55a9c63 /drivers/i3c/master
parent7ccd40edc1f5c43e3f1c7d209336d3981943ab63 (diff)
downloadlinux-b8806e0c939f168237593af0056c309bf31022b0.tar.xz
i3c: mipi-i3c-hci: Do not unmap region not mapped for transfer
Fix following warning (with CONFIG_DMA_API_DEBUG) which happens with a transfer without a data buffer. DMA-API: i3c mipi-i3c-hci.0: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=0 bytes] For those transfers the hci_dma_queue_xfer() doesn't create a mapping and the DMA address pointer xfer->data_dma is not set. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20230921055704.1087277-10-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/i3c/master')
-rw-r--r--drivers/i3c/master/mipi-i3c-hci/dma.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c
index cb41d0026abd..c8720e6334c9 100644
--- a/drivers/i3c/master/mipi-i3c-hci/dma.c
+++ b/drivers/i3c/master/mipi-i3c-hci/dma.c
@@ -347,6 +347,8 @@ static void hci_dma_unmap_xfer(struct i3c_hci *hci,
for (i = 0; i < n; i++) {
xfer = xfer_list + i;
+ if (!xfer->data)
+ continue;
dma_unmap_single(&hci->master.dev,
xfer->data_dma, xfer->data_len,
xfer->rnw ? DMA_FROM_DEVICE : DMA_TO_DEVICE);