Commit c4f2c05
spi: stm32: fix pointer-to-pointer variables usage
In stm32_spi_prepare_rx_dma_mdma_chaining() both rx_dma_desc
and rx_mdma_desc are passed as pointer-to-pointer arguments.
The goal is to pass back to the caller the value returned
by dmaengine_prep_slave_sg(), when it is not NULL.
However, these variables are wrongly handled as simple pointers
during later assignments and checks.
Fix this behaviour by introducing two pointer variables
which can then be treated accordingly.
Fixes: d17dd2f ("spi: stm32: use STM32 DMA with STM32 MDMA to enhance DDR use")
Addresses-Coverity-ID: 1644715 ("Null pointer dereferences (REVERSE_INULL)")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Reviewed-by: Clement LE GOFFIC <clement.legoffic@foss.st.com>
Link: https://patch.msgid.link/20250630081253.17294-1-antonio@mandelbit.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent f4d8438 commit c4f2c05
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1474 | 1474 | | |
1475 | 1475 | | |
1476 | 1476 | | |
| 1477 | + | |
| 1478 | + | |
1477 | 1479 | | |
1478 | 1480 | | |
1479 | 1481 | | |
| |||
1524 | 1526 | | |
1525 | 1527 | | |
1526 | 1528 | | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
1530 | 1532 | | |
1531 | 1533 | | |
1532 | | - | |
| 1534 | + | |
1533 | 1535 | | |
1534 | 1536 | | |
1535 | 1537 | | |
1536 | 1538 | | |
1537 | 1539 | | |
1538 | | - | |
| 1540 | + | |
1539 | 1541 | | |
1540 | 1542 | | |
1541 | 1543 | | |
| |||
1558 | 1560 | | |
1559 | 1561 | | |
1560 | 1562 | | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
1564 | 1566 | | |
1565 | 1567 | | |
1566 | | - | |
1567 | | - | |
| 1568 | + | |
| 1569 | + | |
1568 | 1570 | | |
1569 | 1571 | | |
1570 | 1572 | | |
| |||
0 commit comments