Skip to contentSkip to conversation

ide-scsi cleanup bug

PATCH New sullivan 1 participant 1 message Jul 17, 2002 SCSI

lore
Share & tools
lore

sullivan

author
#0 lore raw

PATCH 1/1 ide-scsi cleanup bug

The following patch is against lk 2.5.26. The prior implementation called scsi_unregister(host) from idescsi_cleanup(), removing the Scsi_Host instance from the scsi_hostlist. Later when scsi_unregister_host(&template) was called from exit_idescsi_module() but since the Scsi_Host instance had already been removed no matches for the template were found and the device instances remained.

The patch moves the scsi_unregister_host(&template) to idescsi_cleanup(). Since scsi_unregister_host() invokes scsi_unregister() this part of the cleanup also occurs normally.

drivers/scsi/ide-scsi.c +2 -4
diff -Naur linux-2.5.26/drivers/scsi/ide-scsi.c linux-2.5.26-patched/drivers/scsi/ide-scsi.c
@@ -491,14 +491,13 @@
 	MOD_DEC_USE_COUNT;
 }
 
+static Scsi_Host_Template template;
 static int idescsi_cleanup (struct ata_device *drive)
 {
-	struct Scsi_Host *host = drive->driver_data;
-
 	if (ide_unregister_subdriver (drive)) {
 		return 1;
 	}
-	scsi_unregister(host);
+	scsi_unregister_host(&template);
 
 	return 0;
 }
@@ -801,7 +800,6 @@
 static void __exit exit_idescsi_module(void)
 {
 	unregister_ata_driver(&ata_ops);
-	scsi_unregister_host(&template);
 }
 
 module_init(init_idescsi_module);