ChangeSet 1.980, 2003/02/04 10:53:38+11:00, [EMAIL PROTECTED]
[PATCH] usb-storage: fix oops
It should fix the OOPS on attach.
This fixes a silly error where I fail to initialize a pointer early enough
for the scanning code. If this isn't a perfect example of why
scsi_register() and scsi_add_host() aren't two separate functions, I don't
know what is. :)
Oh, and I added a couple of comments, too.
- Fix an OOPS by moving the setting of the hostdata[] pointer to _before_
the device scan starts.
diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Tue Feb 4 15:16:59 2003
+++ b/drivers/usb/storage/usb.c Tue Feb 4 15:16:59 2003
@@ -926,6 +926,12 @@
goto BadDevice;
}
+ /* set the hostdata to prepare for scanning */
+ ss->host->hostdata[0] = (unsigned long)ss;
+
+ /* associate this host with our interface */
+ scsi_set_device(ss->host, &intf->dev);
+
/* now add the host */
result = scsi_add_host(ss->host, NULL);
if (result) {
@@ -941,9 +947,6 @@
down(&ss->dev_semaphore);
goto BadDevice;
}
-
- ss->host->hostdata[0] = (unsigned long)ss;
- scsi_set_device(ss->host, &intf->dev);
printk(KERN_DEBUG
"WARNING: USB Mass Storage data integrity not assured\n");
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel