Commit 92dfc9dc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

fix "modules: make module_address_lookup() safe"

Get the constness right, avoid nasty cast.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6d762394
...@@ -449,7 +449,7 @@ static inline void __module_get(struct module *module) ...@@ -449,7 +449,7 @@ static inline void __module_get(struct module *module)
/* For kallsyms to ask for address resolution. namebuf should be at /* For kallsyms to ask for address resolution. namebuf should be at
* least KSYM_NAME_LEN long: a pointer to namebuf is returned if * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
* found, otherwise NULL. */ * found, otherwise NULL. */
char *module_address_lookup(unsigned long addr, const char *module_address_lookup(unsigned long addr,
unsigned long *symbolsize, unsigned long *symbolsize,
unsigned long *offset, unsigned long *offset,
char **modname, char **modname,
...@@ -519,7 +519,7 @@ static inline void module_put(struct module *module) ...@@ -519,7 +519,7 @@ static inline void module_put(struct module *module)
#define module_name(mod) "kernel" #define module_name(mod) "kernel"
/* For kallsyms to ask for address resolution. NULL means not found. */ /* For kallsyms to ask for address resolution. NULL means not found. */
static inline char *module_address_lookup(unsigned long addr, static inline const char *module_address_lookup(unsigned long addr,
unsigned long *symbolsize, unsigned long *symbolsize,
unsigned long *offset, unsigned long *offset,
char **modname, char **modname,
......
...@@ -2253,7 +2253,7 @@ static const char *get_ksymbol(struct module *mod, ...@@ -2253,7 +2253,7 @@ static const char *get_ksymbol(struct module *mod,
/* For kallsyms to ask for address resolution. NULL means not found. Careful /* For kallsyms to ask for address resolution. NULL means not found. Careful
* not to lock to avoid deadlock on oopses, simply disable preemption. */ * not to lock to avoid deadlock on oopses, simply disable preemption. */
char *module_address_lookup(unsigned long addr, const char *module_address_lookup(unsigned long addr,
unsigned long *size, unsigned long *size,
unsigned long *offset, unsigned long *offset,
char **modname, char **modname,
...@@ -2278,7 +2278,7 @@ char *module_address_lookup(unsigned long addr, ...@@ -2278,7 +2278,7 @@ char *module_address_lookup(unsigned long addr,
ret = namebuf; ret = namebuf;
} }
preempt_enable(); preempt_enable();
return (char *)ret; return ret;
} }
int lookup_module_symbol_name(unsigned long addr, char *symname) int lookup_module_symbol_name(unsigned long addr, char *symname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment