spi: mediatek: Avoid NULL pointer crash in interrupt
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>
Mon, 31 Jan 2022 14:17:08 +0000 (15:17 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 31 Jan 2022 15:24:05 +0000 (15:24 +0000)
commit7c3d953fe3d17a1ee672dceb68bb9b790f17675c
tree0dd94d6f1aa9e6eee6ecd861f77ed98f0c681c3f
parent1df17a93f4f090625a7d650be972fb0d11f94f33
spi: mediatek: Avoid NULL pointer crash in interrupt

In some case, like after a transfer timeout, master->cur_msg pointer
is NULL which led to a kernel crash when trying to use master->cur_msg->spi.
mtk_spi_can_dma(), pointed by master->can_dma, doesn't use this parameter
avoid the problem by setting NULL as second parameter.

Fixes: 33bc38a533992 ("spi: mediatek: Add spi bus for Mediatek MT8173")
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Link: https://lore.kernel.org/r/20220131141708.888710-1-benjamin.gaignard@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mt65xx.c