IPMI: fix hotmod remove lock
The removal of proc entries was done holding a lock, which is no longer allowed. There is no need for the lock, only a mutex is required, so switch over to a mutex. Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
612b5a8d3a
commit
ac0191517c
|
@ -221,10 +221,8 @@ struct ipmi_smi
|
||||||
void *send_info;
|
void *send_info;
|
||||||
|
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
/* A list of proc entries for this interface. This does not
|
/* A list of proc entries for this interface. */
|
||||||
need a lock, only one thread creates it and only one thread
|
struct mutex proc_entry_lock;
|
||||||
destroys it. */
|
|
||||||
spinlock_t proc_entry_lock;
|
|
||||||
struct ipmi_proc_entry *proc_entries;
|
struct ipmi_proc_entry *proc_entries;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1891,11 +1889,11 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
|
||||||
file->write_proc = write_proc;
|
file->write_proc = write_proc;
|
||||||
file->owner = owner;
|
file->owner = owner;
|
||||||
|
|
||||||
spin_lock(&smi->proc_entry_lock);
|
mutex_lock(&smi->proc_entry_lock);
|
||||||
/* Stick it on the list. */
|
/* Stick it on the list. */
|
||||||
entry->next = smi->proc_entries;
|
entry->next = smi->proc_entries;
|
||||||
smi->proc_entries = entry;
|
smi->proc_entries = entry;
|
||||||
spin_unlock(&smi->proc_entry_lock);
|
mutex_unlock(&smi->proc_entry_lock);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
|
|
||||||
|
@ -1939,7 +1937,7 @@ static void remove_proc_entries(ipmi_smi_t smi)
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
struct ipmi_proc_entry *entry;
|
struct ipmi_proc_entry *entry;
|
||||||
|
|
||||||
spin_lock(&smi->proc_entry_lock);
|
mutex_lock(&smi->proc_entry_lock);
|
||||||
while (smi->proc_entries) {
|
while (smi->proc_entries) {
|
||||||
entry = smi->proc_entries;
|
entry = smi->proc_entries;
|
||||||
smi->proc_entries = entry->next;
|
smi->proc_entries = entry->next;
|
||||||
|
@ -1948,7 +1946,7 @@ static void remove_proc_entries(ipmi_smi_t smi)
|
||||||
kfree(entry->name);
|
kfree(entry->name);
|
||||||
kfree(entry);
|
kfree(entry);
|
||||||
}
|
}
|
||||||
spin_unlock(&smi->proc_entry_lock);
|
mutex_unlock(&smi->proc_entry_lock);
|
||||||
remove_proc_entry(smi->proc_dir_name, proc_ipmi_root);
|
remove_proc_entry(smi->proc_dir_name, proc_ipmi_root);
|
||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
}
|
}
|
||||||
|
@ -2679,7 +2677,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
|
||||||
}
|
}
|
||||||
intf->curr_seq = 0;
|
intf->curr_seq = 0;
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
spin_lock_init(&intf->proc_entry_lock);
|
mutex_init(&intf->proc_entry_lock);
|
||||||
#endif
|
#endif
|
||||||
spin_lock_init(&intf->waiting_msgs_lock);
|
spin_lock_init(&intf->waiting_msgs_lock);
|
||||||
INIT_LIST_HEAD(&intf->waiting_msgs);
|
INIT_LIST_HEAD(&intf->waiting_msgs);
|
||||||
|
|
Loading…
Reference in New Issue