* [PATCH] fix potential panic with proc on module removal
@ 2005-10-02 17:59 James Bottomley
0 siblings, 0 replies; only message in thread
From: James Bottomley @ 2005-10-02 17:59 UTC (permalink / raw)
To: SCSI Mailing List
There's a problem in our host release in that it calls
scsi_proc_hostdir_rm(). However, if you hold a reference to the host as
you remove the module, the host template (which proc uses) will be freed
and the system will panic when the host device is finally released.
Fix this by moving scsi_proc_hostdir_rm() to where it should be: in
scsi_remove_host().
James
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -176,6 +176,7 @@ void scsi_remove_host(struct Scsi_Host *
transport_unregister_device(&shost->shost_gendev);
class_device_unregister(&shost->shost_classdev);
device_del(&shost->shost_gendev);
+ scsi_proc_hostdir_rm(shost->hostt);
}
EXPORT_SYMBOL(scsi_remove_host);
@@ -262,7 +263,6 @@ static void scsi_host_dev_release(struct
if (shost->work_q)
destroy_workqueue(shost->work_q);
- scsi_proc_hostdir_rm(shost->hostt);
scsi_destroy_command_freelist(shost);
kfree(shost->shost_data);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-02 17:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-02 17:59 [PATCH] fix potential panic with proc on module removal James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox