diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2022-07-19 10:22:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-29 18:14:16 +0300 |
commit | 76668d2a2f367d25ff448e6d7087406af7d7bb2b (patch) | |
tree | bda1c02aadfeb23f6729bb5620fec130c52b8bd4 /samples/mic | |
parent | 50a1d3d097503a90cf84ebe120afcde37e9c33b3 (diff) | |
download | linux-76668d2a2f367d25ff448e6d7087406af7d7bb2b.tar.xz |
spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers
commit 4ceaa684459d414992acbefb4e4c31f2dfc50641 upstream.
In case a IRQ based transfer times out the bcm2835_spi_handle_err()
function is called. Since commit 1513ceee70f2 ("spi: bcm2835: Drop
dma_pending flag") the TX and RX DMA transfers are unconditionally
canceled, leading to NULL pointer derefs if ctlr->dma_tx or
ctlr->dma_rx are not set.
Fix the NULL pointer deref by checking that ctlr->dma_tx and
ctlr->dma_rx are valid pointers before accessing them.
Fixes: 1513ceee70f2 ("spi: bcm2835: Drop dma_pending flag")
Cc: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.kernel.org/r/20220719072234.2782764-1-mkl@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples/mic')
0 files changed, 0 insertions, 0 deletions