PATCH: (as84) Fix my earlier scsi procdir patch

Alan Stern
2003-08-15T20:05:50Z

Mike:

I'm pleased to see that the procdir patch has made it into
2.6.0-test3-bk2. But looking at it again, I realized it has a mistake:
The semaphore isn't released when an error occurs. This patch fixes it.

Alan Stern

===== scsi_proc.c 1.16 vs edited =====
--- 1.16/drivers/scsi/scsi_proc.c Thu Aug 14 18:37:32 2003
+++ edited/drivers/scsi/scsi_proc.c Fri Aug 15 15:40:28 2003
@@ -84,12 +84,11 @@
down(&global_host_template_sem);
if (!sht->present++) {
sht->proc_dir = proc_mkdir(sht->proc_name, proc_scsi);
- if (!sht->proc_dir) {
+ if (!sht->proc_dir)
printk(KERN_ERR "%s: proc_mkdir failed for %s\n",
__FUNCTION__, sht->proc_name);
- return;
- }
- sht->proc_dir->owner = sht->module;
+ else
+ sht->proc_dir->owner = sht->module;
}
up(&global_host_template_sem);
}