summaryrefslogtreecommitdiff
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-01-27 09:48:08 +1000
committerDave Airlie <airlied@redhat.com>2015-01-27 09:48:08 +1000
commit22cbbceff65cb03ee37495b52f360809fa439293 (patch)
tree59ee71a72328743242a2357b0a0af8697d1640e4 /arch/arm/kernel/setup.c
parent104b61590dcd5f71ff518e2b820e1cdf9d0350f2 (diff)
parent26bc420b59a38e4e6685a73345a0def461136dce (diff)
Merge tag 'v3.19-rc6' into drm-fixes
Linux 3.19-rc6 pull in rc6 as the amdkfd fixes are based on it, and I'd rather be doing the merges separately
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 715ae19bc7c8..e55408e96559 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -657,10 +657,13 @@ int __init arm_add_memory(u64 start, u64 size)
/*
* Ensure that start/size are aligned to a page boundary.
- * Size is appropriately rounded down, start is rounded up.
+ * Size is rounded down, start is rounded up.
*/
- size -= start & ~PAGE_MASK;
aligned_start = PAGE_ALIGN(start);
+ if (aligned_start > start + size)
+ size = 0;
+ else
+ size -= aligned_start - start;
#ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT
if (aligned_start > ULONG_MAX) {