diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-10-02 12:59:49 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-10-02 15:20:03 -0500 |
commit | 9e70592fcd87c90e9e98090d66cb79f39d740d4a (patch) | |
tree | 9f0c6493871998b94c50ae18eab88138a33c52ec /drivers/scsi/hosts.c | |
parent | 1640a2c385a860ef25be4a8d18a528c4b6f02bd6 (diff) | |
download | linux-9e70592fcd87c90e9e98090d66cb79f39d740d4a.tar.gz linux-9e70592fcd87c90e9e98090d66cb79f39d740d4a.tar.bz2 linux-9e70592fcd87c90e9e98090d66cb79f39d740d4a.zip |
[SCSI] fix potential panic with proc on module removal
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().
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index f2a72d33132c..02fe371b0ab8 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -176,6 +176,7 @@ void scsi_remove_host(struct Scsi_Host *shost) 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 device *dev) if (shost->work_q) destroy_workqueue(shost->work_q); - scsi_proc_hostdir_rm(shost->hostt); scsi_destroy_command_freelist(shost); kfree(shost->shost_data); |