diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-08-29 09:30:41 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-08-29 09:31:47 +0200 | 
| commit | eebc57f73d42095b778e899f6aa90ad050c72655 (patch) | |
| tree | 2ba80c75e9284093e6d7606dbb1b6a4bb752a2a5 /kernel/module.c | |
| parent | d3a247bfb2c26f5b67367d58af7ad8c2efbbc6c1 (diff) | |
| parent | 2a4ab640d3c28c2952967e5f63ea495555bf2a5f (diff) | |
Merge branch 'for-ingo' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-sfi-2.6 into x86/apic
Merge reason: the SFI (Simple Firmware Interface) feature in the ACPI
              tree needs this cleanup, pull it into the APIC branch as
	      well so that there's no interactions.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/kernel/module.c b/kernel/module.c index 0a049837008e..eccb561dd8a3 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);  } @@ -1068,7 +1070,8 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs,  {  	const unsigned long *crc; -	if (!find_symbol("module_layout", NULL, &crc, true, false)) +	if (!find_symbol(MODULE_SYMBOL_PREFIX "module_layout", NULL, +			 &crc, true, false))  		BUG();  	return check_version(sechdrs, versindex, "module_layout", mod, crc);  } @@ -2352,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); | 
