diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-07-26 03:52:21 +0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-07-26 03:52:21 +0400 |
commit | 5ffdcd94ea0171cf9a3ca63051c2246426103b5b (patch) | |
tree | dfa1522796d5af649caf64ac6e2f1e69119e85d0 /kernel/module.c | |
parent | cf40f082f8d3a98e28af02af20d00d2500eb6a65 (diff) | |
parent | b37fa16e78d6f9790462b3181602a26b5af36260 (diff) | |
download | linux-5ffdcd94ea0171cf9a3ca63051c2246426103b5b.tar.xz |
Merge commit 'v2.6.35-rc6' into spi/test
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/kernel/module.c b/kernel/module.c index 8c6b42840dd1..5d2d28197c82 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2062,6 +2062,12 @@ static void dynamic_debug_setup(struct _ddebug *debug, unsigned int num) #endif } +static void dynamic_debug_remove(struct _ddebug *debug) +{ + if (debug) + ddebug_remove_module(debug->modname); +} + static void *module_alloc_update_bounds(unsigned long size) { void *ret = module_alloc(size); @@ -2124,6 +2130,8 @@ static noinline struct module *load_module(void __user *umod, void *ptr = NULL; /* Stops spurious gcc warning */ unsigned long symoffs, stroffs, *strmap; void __percpu *percpu; + struct _ddebug *debug = NULL; + unsigned int num_debug = 0; mm_segment_t old_fs; @@ -2476,15 +2484,9 @@ static noinline struct module *load_module(void __user *umod, kfree(strmap); strmap = NULL; - if (!mod->taints) { - struct _ddebug *debug; - unsigned int num_debug; - + if (!mod->taints) debug = section_objs(hdr, sechdrs, secstrings, "__verbose", sizeof(*debug), &num_debug); - if (debug) - dynamic_debug_setup(debug, num_debug); - } err = module_finalize(hdr, sechdrs, mod); if (err < 0) @@ -2526,10 +2528,13 @@ static noinline struct module *load_module(void __user *umod, goto unlock; } + if (debug) + dynamic_debug_setup(debug, num_debug); + /* Find duplicate symbols */ err = verify_export_symbols(mod); if (err < 0) - goto unlock; + goto ddebug; list_add_rcu(&mod->list, &modules); mutex_unlock(&module_mutex); @@ -2557,6 +2562,8 @@ static noinline struct module *load_module(void __user *umod, mutex_lock(&module_mutex); /* Unlink carefully: kallsyms could be walking list. */ list_del_rcu(&mod->list); + ddebug: + dynamic_debug_remove(debug); unlock: mutex_unlock(&module_mutex); synchronize_sched(); |