Skip to content

Commit 78d0f94

Browse files
juru1234davem330
authored andcommitted
s390/ism: Fix trying to free already-freed IRQ by repeated ism_dev_exit()
This patch prevents the system from crashing when unloading the ISM module. How to reproduce: Attach an ISM device and execute 'rmmod ism'. Error-Log: - Trying to free already-free IRQ 0 - WARNING: CPU: 1 PID: 966 at kernel/irq/manage.c:1890 free_irq+0x140/0x540 After calling ism_dev_exit() for each ISM device in the exit routine, pci_unregister_driver() will execute ism_remove() for each ISM device. Because ism_remove() also calls ism_dev_exit(), free_irq(pci_irq_vector(pdev, 0), ism) is called twice for each ISM device. This results in a crash with the error 'Trying to free already-free IRQ'. In the exit routine, it is enough to call pci_unregister_driver() because it ensures that ism_dev_exit() is called once per ISM device. Cc: <[email protected]> # 6.3+ Fixes: 89e7d2b ("net/ism: Add new API for client registration") Reviewed-by: Niklas Schnelle <[email protected]> Signed-off-by: Julian Ruess <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6ac7a27 commit 78d0f94

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

drivers/s390/net/ism_drv.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -771,14 +771,6 @@ static int __init ism_init(void)
771771

772772
static void __exit ism_exit(void)
773773
{
774-
struct ism_dev *ism;
775-
776-
mutex_lock(&ism_dev_list.mutex);
777-
list_for_each_entry(ism, &ism_dev_list.list, list) {
778-
ism_dev_exit(ism);
779-
}
780-
mutex_unlock(&ism_dev_list.mutex);
781-
782774
pci_unregister_driver(&ism_driver);
783775
debug_unregister(ism_debug_info);
784776
}

0 commit comments

Comments
 (0)