Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95718
b: refs/heads/master
c: df4b565
h: refs/heads/master
v: v3
  • Loading branch information
Peter Oberparleiter authored and Rusty Russell committed May 1, 2008
1 parent 2999997 commit 78ecf5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b211104d111c99dbb97c636b57bd9db711455684
refs/heads/master: df4b565e1fbc777bb6e274378a41fa8ff7485680
11 changes: 7 additions & 4 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,13 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
if (!forced && module_refcount(mod) != 0)
wait_for_zero_refcount(mod);

mutex_unlock(&module_mutex);
/* Final destruction now noone is using it. */
if (mod->exit != NULL) {
mutex_unlock(&module_mutex);
if (mod->exit != NULL)
mod->exit();
mutex_lock(&module_mutex);
}
blocking_notifier_call_chain(&module_notify_list,
MODULE_STATE_GOING, mod);
mutex_lock(&module_mutex);
/* Store the name of the last unloaded module for diagnostic purposes */
strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
free_module(mod);
Expand Down Expand Up @@ -2191,6 +2192,8 @@ sys_init_module(void __user *umod,
mod->state = MODULE_STATE_GOING;
synchronize_sched();
module_put(mod);
blocking_notifier_call_chain(&module_notify_list,
MODULE_STATE_GOING, mod);
mutex_lock(&module_mutex);
free_module(mod);
mutex_unlock(&module_mutex);
Expand Down

0 comments on commit 78ecf5f

Please sign in to comment.