From 350e26aaf9598820f0cca9e238a418fe04c32aff Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 16 Aug 2003 00:31:45 -0500 Subject: [PATCH] [PATCH] Re: scsi proc_info called unconditionally On Sat, Aug 16, 2003 at 10:44:09AM +0200, Olaf Hering wrote: > > Why is ->proc_info() called when the function pointer is NULL? Looks like the check for it's presence got lost in [PATCH] Correct removal of procfs host enteries [1/2] Here's a trivial patch to get it back: --- drivers/scsi/scsi_proc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index 900ae00a51a62..dd8bfd4b36c68 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -81,6 +81,9 @@ out: void scsi_proc_hostdir_add(struct scsi_host_template *sht) { + if (!sht->proc_info) + return; + down(&global_host_template_sem); if (!sht->present++) { sht->proc_dir = proc_mkdir(sht->proc_name, proc_scsi); @@ -96,6 +99,9 @@ void scsi_proc_hostdir_add(struct scsi_host_template *sht) void scsi_proc_hostdir_rm(struct scsi_host_template *sht) { + if (!sht->proc_info) + return; + down(&global_host_template_sem); if (!--sht->present && sht->proc_dir) { remove_proc_entry(sht->proc_name, proc_scsi); -- 2.53.0