summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/sparsemem.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-08-10 22:44:24 +0200
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-20 07:53:23 +0200
commita11940978bd598e65996b4f807cf4904793f7025 (patch)
tree95a62b555abb28b0334f8eea8c856a3c0c0c5991 /arch/powerpc/include/asm/sparsemem.h
parentpowerpc: Coding style cleanups (diff)
downloadlinux-a11940978bd598e65996b4f807cf4904793f7025.tar.xz
linux-a11940978bd598e65996b4f807cf4904793f7025.zip
powerpc: Fix oops when echoing bad values to /sys/devices/system/memory/probe
If we echo an address the hypervisor doesn't like to /sys/devices/system/memory/probe we oops the box: # echo 0x10000000000 > /sys/devices/system/memory/probe kernel BUG at arch/powerpc/mm/hash_utils_64.c:541! The backtrace is: create_section_mapping arch_add_memory add_memory memory_probe_store sysdev_class_store sysfs_write_file vfs_write SyS_write In create_section_mapping we BUG if htab_bolt_mapping returned an error. A better approach is to return an error which will propagate back to userspace. Rerunning the test with this patch applied: # echo 0x10000000000 > /sys/devices/system/memory/probe -bash: echo: write error: Invalid argument Signed-off-by: Anton Blanchard <anton@samba.org> Cc: stable@kernel.org Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/sparsemem.h')
-rw-r--r--arch/powerpc/include/asm/sparsemem.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/sparsemem.h b/arch/powerpc/include/asm/sparsemem.h
index 54a47ea2c3aa..0c5fa3145615 100644
--- a/arch/powerpc/include/asm/sparsemem.h
+++ b/arch/powerpc/include/asm/sparsemem.h
@@ -16,7 +16,7 @@
#endif /* CONFIG_SPARSEMEM */
#ifdef CONFIG_MEMORY_HOTPLUG
-extern void create_section_mapping(unsigned long start, unsigned long end);
+extern int create_section_mapping(unsigned long start, unsigned long end);
extern int remove_section_mapping(unsigned long start, unsigned long end);
#ifdef CONFIG_NUMA
extern int hot_add_scn_to_nid(unsigned long scn_addr);