]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/module.c
Merge commit 'v2.6.31-rc8' into sched/core
[mv-sheeva.git] / kernel / module.c
index fd141140355889abd13630c663e66a2e87267194..eccb561dd8a390a7ad1c11396b6a7448c0125548 100644 (file)
@@ -909,16 +909,18 @@ void __symbol_put(const char *symbol)
 }
 EXPORT_SYMBOL(__symbol_put);
 
+/* Note this assumes addr is a function, which it currently always is. */
 void symbol_put_addr(void *addr)
 {
        struct module *modaddr;
+       unsigned long a = (unsigned long)dereference_function_descriptor(addr);
 
-       if (core_kernel_text((unsigned long)addr))
+       if (core_kernel_text(a))
                return;
 
        /* module_text_address is safe here: we're supposed to have reference
         * to module from symbol_get, so it can't go away. */
-       modaddr = __module_text_address((unsigned long)addr);
+       modaddr = __module_text_address(a);
        BUG_ON(!modaddr);
        module_put(modaddr);
 }
@@ -2353,7 +2355,8 @@ static noinline struct module *load_module(void __user *umod,
        if (err < 0)
                goto unlink;
        add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
-       add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
+       if (mod->sect_attrs)
+               add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
 
        /* Get rid of temporary copy */
        vfree(hdr);