diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-05 13:13:03 -0400 | 
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-05 13:13:03 -0400 | 
| commit | 5e66dd6d66ffe758b39b6dcadf2330753ee1159b (patch) | |
| tree | a72cdcff4448e4af9425cc213ddf56ab23e697fe /kernel/module.c | |
| parent | 026477c1141b67e98e3bd8bdedb7d4b88a3ecd09 (diff) | |
| parent | ca78f6baca863afe2e6a244a0fe94b3a70211d46 (diff) | |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 26 | 
1 files changed, 26 insertions, 0 deletions
| diff --git a/kernel/module.c b/kernel/module.c index 281172f01e9a..35e1b1f859d7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1121,6 +1121,9 @@ static void free_module(struct module *mod)  	if (mod->percpu)  		percpu_modfree(mod->percpu); +	/* Free lock-classes: */ +	lockdep_free_key_range(mod->module_core, mod->core_size); +  	/* Finally, free the core (containing the module structure) */  	module_free(mod, mod->module_core);  } @@ -2159,6 +2162,29 @@ const struct exception_table_entry *search_module_extables(unsigned long addr)  	return e;  } +/* + * Is this a valid module address? + */ +int is_module_address(unsigned long addr) +{ +	unsigned long flags; +	struct module *mod; + +	spin_lock_irqsave(&modlist_lock, flags); + +	list_for_each_entry(mod, &modules, list) { +		if (within(addr, mod->module_core, mod->core_size)) { +			spin_unlock_irqrestore(&modlist_lock, flags); +			return 1; +		} +	} + +	spin_unlock_irqrestore(&modlist_lock, flags); + +	return 0; +} + +  /* Is this a valid kernel address?  We don't grab the lock: we are oopsing. */  struct module *__module_text_address(unsigned long addr)  { | 
