diff options
author | Michael Walle <[email protected]> | 2021-11-11 09:37:13 +0100 |
---|---|---|
committer | Mark Brown <[email protected]> | 2021-11-12 18:18:03 +0000 |
commit | 6c53b45c71b4920b5e62f0ea8079a1da382b9434 (patch) | |
tree | 88fa899b8a1afdf75f87aa0123590884049a571f /scripts/gdb/linux/utils.py | |
parent | 6532582c353f4c83e3ccdd7255020ab852b90b0b (diff) |
spi: fix use-after-free of the add_lock mutex
Commit 6098475d4cb4 ("spi: Fix deadlock when adding SPI controllers on
SPI buses") introduced a per-controller mutex. But mutex_unlock() of
said lock is called after the controller is already freed:
spi_unregister_controller(ctlr)
-> put_device(&ctlr->dev)
-> spi_controller_release(dev)
-> mutex_unlock(&ctrl->add_lock)
Move the put_device() after the mutex_unlock().
Fixes: 6098475d4cb4 ("spi: Fix deadlock when adding SPI controllers on SPI buses")
Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
Reviewed-by: Lukas Wunner <[email protected]>
Cc: [email protected] # v5.15
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions