summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-09-04 02:22:21 -0700
committerDavid S. Miller <davem@davemloft.net>2009-09-04 02:22:21 -0700
commita29889a5369d2604c2053bcd051519a2445d8a70 (patch)
treeb17e8258894d079b4168994d9438ba7d6e7d1523 /kernel/module.c
parente7a088f935180b90cfe6ab0aaae8a556f46885fe (diff)
parent37d0892c5a94e208cf863e3b7bac014edee4346d (diff)
downloadop-kernel-dev-a29889a5369d2604c2053bcd051519a2445d8a70.zip
op-kernel-dev-a29889a5369d2604c2053bcd051519a2445d8a70.tar.gz
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c
index fd141140..2d53718 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -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);
}
@@ -1272,6 +1274,10 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect,
struct module_notes_attrs *notes_attrs;
struct bin_attribute *nattr;
+ /* failed to create section attributes, so can't create notes */
+ if (!mod->sect_attrs)
+ return;
+
/* Count notes sections and allocate structures. */
notes = 0;
for (i = 0; i < nsect; i++)
OpenPOWER on IntegriCloud