summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hansg@kernel.org>2025-06-23 10:50:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-24 16:39:01 +0100
commit35b7f3525fe0a7283de7116e3c75ee3ccb3b14c9 (patch)
treeea9ea67d71da8a4cab26e847ee648113d5fb3dcb
parent78ab08efa3f8502677b3fa5afb66f73b526a6d90 (diff)
mei: vsc: Destroy mutex after freeing the IRQ
The event_notify callback which runs from vsc_tp_thread_isr may call vsc_tp_xfer() which locks the mutex. So the ISR depends on the mutex. Move the mutex_destroy() call to after free_irq() to ensure that the ISR is not running while the mutex is destroyed. Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device") Signed-off-by: Hans de Goede <hansg@kernel.org> Link: https://lore.kernel.org/r/20250623085052.12347-6-hansg@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/mei/vsc-tp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c
index f5438a600430..0feebffabdb3 100644
--- a/drivers/misc/mei/vsc-tp.c
+++ b/drivers/misc/mei/vsc-tp.c
@@ -521,10 +521,10 @@ static int vsc_tp_probe(struct spi_device *spi)
return 0;
err_destroy_lock:
- mutex_destroy(&tp->mutex);
-
free_irq(spi->irq, tp);
+ mutex_destroy(&tp->mutex);
+
return ret;
}
@@ -535,9 +535,9 @@ static void vsc_tp_remove(struct spi_device *spi)
platform_device_unregister(tp->pdev);
- mutex_destroy(&tp->mutex);
-
free_irq(spi->irq, tp);
+
+ mutex_destroy(&tp->mutex);
}
static const struct acpi_device_id vsc_tp_acpi_ids[] = {