Merge tag 'mmc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
[linux-2.6-microblaze.git] / kernel / module.c
index 72ed2b3..a0f201d 100644 (file)
@@ -2400,7 +2400,7 @@ static void layout_sections(struct module *mod, struct load_info *info)
                        if ((s->sh_flags & masks[m][0]) != masks[m][0]
                            || (s->sh_flags & masks[m][1])
                            || s->sh_entsize != ~0UL
-                           || strstarts(sname, ".init"))
+                           || module_init_section(sname))
                                continue;
                        s->sh_entsize = get_offset(mod, &mod->core_layout.size, s, i);
                        pr_debug("\t%s\n", sname);
@@ -2433,7 +2433,7 @@ static void layout_sections(struct module *mod, struct load_info *info)
                        if ((s->sh_flags & masks[m][0]) != masks[m][0]
                            || (s->sh_flags & masks[m][1])
                            || s->sh_entsize != ~0UL
-                           || !strstarts(sname, ".init"))
+                           || !module_init_section(sname))
                                continue;
                        s->sh_entsize = (get_offset(mod, &mod->init_layout.size, s, i)
                                         | INIT_OFFSET_MASK);
@@ -2768,6 +2768,11 @@ void * __weak module_alloc(unsigned long size)
        return vmalloc_exec(size);
 }
 
+bool __weak module_init_section(const char *name)
+{
+       return strstarts(name, ".init");
+}
+
 bool __weak module_exit_section(const char *name)
 {
        return strstarts(name, ".exit");
@@ -2946,8 +2951,7 @@ static int copy_module_from_user(const void __user *umod, unsigned long len,
                return err;
 
        /* Suck in entire file: we'll want most of it. */
-       info->hdr = __vmalloc(info->len,
-                       GFP_KERNEL | __GFP_NOWARN, PAGE_KERNEL);
+       info->hdr = __vmalloc(info->len, GFP_KERNEL | __GFP_NOWARN);
        if (!info->hdr)
                return -ENOMEM;