Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32626
b: refs/heads/master
c: 098c5ee
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Linus Torvalds committed Jul 15, 2006
1 parent 52d0656 commit fe11463
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 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: 329c6e4257d6a89990d72617d91437e2ce59e426
refs/heads/master: 098c5eea03de4707019a205140296893252b4130
10 changes: 4 additions & 6 deletions trunk/include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,8 @@ int is_module_address(unsigned long addr);

/* Returns module and fills in value, defined and namebuf, or NULL if
symnum out of range. */
struct module *module_get_kallsym(unsigned int symnum,
unsigned long *value,
char *type,
char namebuf[128]);
struct module *module_get_kallsym(unsigned int symnum, unsigned long *value,
char *type, char *name, size_t namelen);

/* Look for this name: can be of form module:name. */
unsigned long module_kallsyms_lookup_name(const char *name);
Expand Down Expand Up @@ -535,8 +533,8 @@ static inline const char *module_address_lookup(unsigned long addr,

static inline struct module *module_get_kallsym(unsigned int symnum,
unsigned long *value,
char *type,
char namebuf[128])
char *type, char *name,
size_t namelen)
{
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ static void upcase_if_global(struct kallsym_iter *iter)
static int get_ksymbol_mod(struct kallsym_iter *iter)
{
iter->owner = module_get_kallsym(iter->pos - kallsyms_num_syms,
&iter->value,
&iter->type, iter->name);
&iter->value, &iter->type,
iter->name, sizeof(iter->name));
if (iter->owner == NULL)
return 0;

Expand Down
11 changes: 4 additions & 7 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,10 +2019,8 @@ const char *module_address_lookup(unsigned long addr,
return NULL;
}

struct module *module_get_kallsym(unsigned int symnum,
unsigned long *value,
char *type,
char namebuf[128])
struct module *module_get_kallsym(unsigned int symnum, unsigned long *value,
char *type, char *name, size_t namelen)
{
struct module *mod;

Expand All @@ -2031,9 +2029,8 @@ struct module *module_get_kallsym(unsigned int symnum,
if (symnum < mod->num_symtab) {
*value = mod->symtab[symnum].st_value;
*type = mod->symtab[symnum].st_info;
strncpy(namebuf,
mod->strtab + mod->symtab[symnum].st_name,
127);
strlcpy(name, mod->strtab + mod->symtab[symnum].st_name,
namelen);
mutex_unlock(&module_mutex);
return mod;
}
Expand Down

0 comments on commit fe11463

Please sign in to comment.