Skip to content

Commit 1d25943

Browse files
committed
mei: vsc: Destroy mutex after freeing the IRQ
JIRA: https://issues.redhat.com/browse/RHEL-113185 commit 35b7f35 Author: Hans de Goede <hansg@kernel.org> Date: Mon Jun 23 10:50:47 2025 +0200 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: 566f5ca ("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> Signed-off-by: Steve Best <sbest@redhat.com>
1 parent 045a072 commit 1d25943

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/misc/mei/vsc-tp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,10 @@ static int vsc_tp_probe(struct spi_device *spi)
521521
return 0;
522522

523523
err_destroy_lock:
524-
mutex_destroy(&tp->mutex);
525-
526524
free_irq(spi->irq, tp);
527525

526+
mutex_destroy(&tp->mutex);
527+
528528
return ret;
529529
}
530530

@@ -535,9 +535,9 @@ static void vsc_tp_remove(struct spi_device *spi)
535535

536536
platform_device_unregister(tp->pdev);
537537

538-
mutex_destroy(&tp->mutex);
539-
540538
free_irq(spi->irq, tp);
539+
540+
mutex_destroy(&tp->mutex);
541541
}
542542

543543
static const struct acpi_device_id vsc_tp_acpi_ids[] = {

0 commit comments

Comments
 (0)