Skip to content

Commit

Permalink
x86-32, numa: Fix failure condition check in alloc_remap()
Browse files Browse the repository at this point in the history
node_remap_{start|end}_vaddr[] describe [start, end) ranges; however,
alloc_remap() incorrectly failed when the current allocation + size
equaled the end but it should fail only when it goes over.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/1301955840-7246-2-git-send-email-tj@kernel.org
Acked-by: Yinghai Lu <yinghai@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Tejun Heo authored and H. Peter Anvin committed Apr 7, 2011
1 parent 6221f22 commit 3fe14ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/mm/numa_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void *alloc_remap(int nid, unsigned long size)

size = ALIGN(size, L1_CACHE_BYTES);

if (!allocation || (allocation + size) >= node_remap_end_vaddr[nid])
if (!allocation || (allocation + size) > node_remap_end_vaddr[nid])
return NULL;

node_remap_alloc_vaddr[nid] += size;
Expand Down

0 comments on commit 3fe14ab

Please sign in to comment.