diff options
author | Alexey Dobriyan <adobriyan@sw.ru> | 2007-05-08 00:28:38 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 11:15:08 -0700 |
commit | ae84e324709d6320ed8c1fd7b1736fcbaf26df95 (patch) | |
tree | bb3b623f2fd491771c716957622a72e86e9582dd /kernel/module.c | |
parent | 55955aad7c09e4d93029d0cf2d360b41891f2fe4 (diff) |
Simplify module_get_kallsym() by dropping length arg
module_get_kallsym() could in theory truncate module symbol name to fit in
buffer, but nobody does this. Always use KSYM_NAME_LEN + 1 bytes for name.
Suggested by lg^WRusty.
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c index 9bdbd1217a6..43a529a1fa4 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -19,6 +19,7 @@ #include <linux/module.h> #include <linux/moduleloader.h> #include <linux/init.h> +#include <linux/kallsyms.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/vmalloc.h> @@ -2124,7 +2125,7 @@ const char *module_address_lookup(unsigned long addr, } struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, - char *type, char *name, size_t namelen) + char *type, char *name) { struct module *mod; @@ -2134,7 +2135,7 @@ struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, *value = mod->symtab[symnum].st_value; *type = mod->symtab[symnum].st_info; strlcpy(name, mod->strtab + mod->symtab[symnum].st_name, - namelen); + KSYM_NAME_LEN + 1); mutex_unlock(&module_mutex); return mod; } |