aboutsummaryrefslogtreecommitdiff
path: root/Kconfig
diff options
context:
space:
mode:
authorGravatar Bartosz Golaszewski <bartosz.golaszewski@linaro.org> 2023-01-06 11:07:18 +0100
committerGravatar Mark Brown <broonie@kernel.org> 2023-01-06 17:45:42 +0000
commit1f4d2dd45b6ef9c047f620d2812326a7813d2354 (patch)
tree668420886c18e0fe80a24b0e931c707293719407 /Kconfig
parentspi: SPI core CS delay property rename (diff)
downloadlinux-1f4d2dd45b6ef9c047f620d2812326a7813d2354.tar.gz
linux-1f4d2dd45b6ef9c047f620d2812326a7813d2354.tar.bz2
linux-1f4d2dd45b6ef9c047f620d2812326a7813d2354.zip
spi: spidev: fix a race condition when accessing spidev->spi
There's a spinlock in place that is taken in file_operations callbacks whenever we check if spidev->spi is still alive (not null). It's also taken when spidev->spi is set to NULL in remove(). This however doesn't protect the code against driver unbind event while one of the syscalls is still in progress. To that end we need a lock taken continuously as long as we may still access spidev->spi. As both the file ops and the remove callback are never called from interrupt context, we can replace the spinlock with a mutex. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20230106100719.196243-1-brgl@bgdev.pl Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Kconfig')
0 files changed, 0 insertions, 0 deletions