I just checked, and noticed that a few usage counter incrementations
were not correctly undone in the floppy driver when resource
allocation failed.
The following patch should fix the problems:
diff -ur 2.0.16/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- 2.0.16/linux/drivers/block/floppy.c Mon Sep 2 08:38:15 1996
+++ linux/drivers/block/floppy.c Mon Sep 2 08:47:08 1996
@@ -4067,12 +4067,16 @@
if (fd_request_irq()) {
DPRINT("Unable to grab IRQ%d for the floppy driver\n",
FLOPPY_IRQ);
+ MOD_DEC_USE_COUNT;
+ usage_count--;
return -1;
}
if (fd_request_dma()) {
DPRINT("Unable to grab DMA%d for the floppy driver\n",
FLOPPY_DMA);
fd_free_irq();
+ MOD_DEC_USE_COUNT;
+ usage_count--;
return -1;
}
for (fdc = 0; fdc < N_FDC; fdc++)
@@ -4098,7 +4102,6 @@
return;
}
INT_ON;
- MOD_DEC_USE_COUNT;
fd_disable_dma();
fd_free_dma();
fd_disable_irq();
@@ -4131,6 +4134,7 @@
if (floppy_tq.sync)
printk("task queue still active\n");
#endif
+ MOD_DEC_USE_COUNT;
}
Regards,
Alain