Commit 73e8f3d7 authored by T Makphaibulchoke's avatar T Makphaibulchoke Committed by Ingo Molnar

x86/mm/init.c: Fix devmem_is_allowed() off by one

Fixing an off-by-one error in devmem_is_allowed(), which allows
accesses to physical addresses 0x100000-0x100fff, an extra page
past 1MB.
Signed-off-by: default avatarT Makphaibulchoke <tmac@hp.com>
Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
Cc: yinghai@kernel.org
Cc: tiwai@suse.de
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/1346210503-14276-1-git-send-email-tmac@hp.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 4454d327
...@@ -319,7 +319,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, ...@@ -319,7 +319,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
*/ */
int devmem_is_allowed(unsigned long pagenr) int devmem_is_allowed(unsigned long pagenr)
{ {
if (pagenr <= 256) if (pagenr < 256)
return 1; return 1;
if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment