patch-2.1.78 linux/drivers/block/acsi.c

Next file: linux/drivers/block/floppy.c
Previous file: linux/drivers/ap1000/ddv.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.77/linux/drivers/block/acsi.c linux/drivers/block/acsi.c
@@ -1820,12 +1820,19 @@
 
 void cleanup_module(void)
 {
+	struct gendisk ** gdp;
+
 	del_timer( &acsi_timer );
 	blk_dev[MAJOR_NR].request_fn = 0;
 	free_pages( (unsigned long)acsi_buffer, ACSI_BUFFER_ORDER );
 
 	if (unregister_blkdev( MAJOR_NR, "ad" ) != 0)
 		printk( KERN_ERR "acsi: cleanup_module failed\n");
+	for (gdp = &gendisk_head; *gdp; gdp = &((*gdp)->next))
+		if (*gdp == &acsi_gendisk)
+			break;
+	if (*gdp)
+		*gdp = (*gdp)->next;
 }
 #endif
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov