Suggestion for aiding debugging of host removal

Alan Stern
2003-12-10T15:02:23Z

Mike:

I've got a question about host removal. Once scsi_remove_host() has
returned, the host driver's module is free to unload from memory (assuming
the module's reference count is 0, which it normally is). Hence it is a
mistake to access the host template in any way after that time.

But it looks like scsi_host_dev_release() can be called after
scsi_remove_host() has returned, and it uses shost->hostt. There may be
other uses as well.

Would it help flush out such illegal accesses if at some appropriate point
shost->hostt was set to NULL, maybe near the end of scsi_remove_host()?

Alan Stern