summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/mod/file2alias.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 7be43697ff84..ba4ebc4b346e 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1415,11 +1415,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT)
return;
- /* All our symbols are of form <prefix>__mod_<name>__<identifier>_device_table. */
- name = strstr(symname, "__mod_");
- if (!name)
+ /* All our symbols are of form __mod_<name>__<identifier>_device_table. */
+ if (strncmp(symname, "__mod_", strlen("__mod_")))
return;
- name += strlen("__mod_");
+ name = symname + strlen("__mod_");
namelen = strlen(name);
if (namelen < strlen("_device_table"))
return;