diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/module.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 39827c3d9484..c54f10d90e1c 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -1797,6 +1797,17 @@ static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs, | |||
| 1797 | } | 1797 | } |
| 1798 | } | 1798 | } |
| 1799 | 1799 | ||
| 1800 | static void free_modinfo(struct module *mod) | ||
| 1801 | { | ||
| 1802 | struct module_attribute *attr; | ||
| 1803 | int i; | ||
| 1804 | |||
| 1805 | for (i = 0; (attr = modinfo_attrs[i]); i++) { | ||
| 1806 | if (attr->free) | ||
| 1807 | attr->free(mod); | ||
| 1808 | } | ||
| 1809 | } | ||
| 1810 | |||
| 1800 | #ifdef CONFIG_KALLSYMS | 1811 | #ifdef CONFIG_KALLSYMS |
| 1801 | 1812 | ||
| 1802 | /* lookup symbol in given range of kernel_symbols */ | 1813 | /* lookup symbol in given range of kernel_symbols */ |
| @@ -2506,6 +2517,7 @@ static noinline struct module *load_module(void __user *umod, | |||
| 2506 | synchronize_sched(); | 2517 | synchronize_sched(); |
| 2507 | module_arch_cleanup(mod); | 2518 | module_arch_cleanup(mod); |
| 2508 | cleanup: | 2519 | cleanup: |
| 2520 | free_modinfo(mod); | ||
| 2509 | kobject_del(&mod->mkobj.kobj); | 2521 | kobject_del(&mod->mkobj.kobj); |
| 2510 | kobject_put(&mod->mkobj.kobj); | 2522 | kobject_put(&mod->mkobj.kobj); |
| 2511 | free_unload: | 2523 | free_unload: |
