]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: tegra210-quad: Move curr_xfer read inside spinlock
authorBreno Leitao <leitao@debian.org>
Mon, 26 Jan 2026 17:50:27 +0000 (09:50 -0800)
committerMark Brown <broonie@kernel.org>
Fri, 30 Jan 2026 13:53:13 +0000 (13:53 +0000)
commitef13ba357656451d6371940d8414e3e271df97e3
tree2fe22c2e3e25cdab4a00696d925a5f3ba5106d2e
parentaabd8ea0aa253d40cf5f20a609fc3d6f61e38299
spi: tegra210-quad: Move curr_xfer read inside spinlock

Move the assignment of the transfer pointer from curr_xfer inside the
spinlock critical section in both handle_cpu_based_xfer() and
handle_dma_based_xfer().

Previously, curr_xfer was read before acquiring the lock, creating a
window where the timeout path could clear curr_xfer between reading it
and using it. By moving the read inside the lock, the handlers are
guaranteed to see a consistent value that cannot be modified by the
timeout path.

Fixes: 921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260126-tegra_xfer-v2-2-6d2115e4f387@debian.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-tegra210-quad.c