drivers: spi: Fix DMA overflow in NXP MCUX driver

When using a dummy buffer on the RX side, do not
increment the destination memory buffer address.
This issue was uncovered when running the SPI
loopback test.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
Mahesh Mahadevan 2023-04-19 11:38:13 -05:00 committed by David Leach
parent 629f8d83b5
commit eebd665150

View file

@ -519,6 +519,7 @@ static int spi_mcux_dma_rx_load(const struct device *dev, uint8_t *buf,
if (buf == NULL) {
/* if rx buff is null, then write data to dummy address. */
blk_cfg->dest_address = (uint32_t)&dummy_rx_buffer;
blk_cfg->dest_addr_adj = DMA_ADDR_ADJ_NO_CHANGE;
} else {
blk_cfg->dest_address = (uint32_t)buf;
}