Skip to content

Commit b8806e0

Browse files
jhnikulaalexandrebelloni
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 7ccd40e commit b8806e0

File tree

1 file changed

+2
-0
lines changed
  • drivers/i3c/master/mipi-i3c-hci

1 file changed

+2
-0
lines changed

drivers/i3c/master/mipi-i3c-hci/dma.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ static void hci_dma_unmap_xfer(struct i3c_hci *hci,
347347

348348
for (i = 0; i < n; i++) {
349349
xfer = xfer_list + i;
350+
if (!xfer->data)
351+
continue;
350352
dma_unmap_single(&hci->master.dev,
351353
xfer->data_dma, xfer->data_len,
352354
xfer->rnw ? DMA_FROM_DEVICE : DMA_TO_DEVICE);

0 commit comments

Comments
 (0)