aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 8b7d8805819d..1eb952097077 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2043,9 +2043,7 @@ static void kmemleak_load_module(struct module *mod, Elf_Ehdr *hdr,
2043 unsigned int i; 2043 unsigned int i;
2044 2044
2045 /* only scan the sections containing data */ 2045 /* only scan the sections containing data */
2046 kmemleak_scan_area(mod->module_core, (unsigned long)mod - 2046 kmemleak_scan_area(mod, sizeof(struct module), GFP_KERNEL);
2047 (unsigned long)mod->module_core,
2048 sizeof(struct module), GFP_KERNEL);
2049 2047
2050 for (i = 1; i < hdr->e_shnum; i++) { 2048 for (i = 1; i < hdr->e_shnum; i++) {
2051 if (!(sechdrs[i].sh_flags & SHF_ALLOC)) 2049 if (!(sechdrs[i].sh_flags & SHF_ALLOC))
@@ -2054,8 +2052,7 @@ static void kmemleak_load_module(struct module *mod, Elf_Ehdr *hdr,
2054 && strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) != 0) 2052 && strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) != 0)
2055 continue; 2053 continue;
2056 2054
2057 kmemleak_scan_area(mod->module_core, sechdrs[i].sh_addr - 2055 kmemleak_scan_area((void *)sechdrs[i].sh_addr,
2058 (unsigned long)mod->module_core,
2059 sechdrs[i].sh_size, GFP_KERNEL); 2056 sechdrs[i].sh_size, GFP_KERNEL);
2060 } 2057 }
2061} 2058}