Skip to content

Commit

Permalink
[S390] vmemmap: fix off-by-one bug.
Browse files Browse the repository at this point in the history
If a memory range is supposed to be added to the 1:1 mapping and it
ends just below the maximum supported physical address it won't
succeed. This is because a test doesn't consider that the end address
is 1 smaller than start + size.
Fix the comparison.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jun 10, 2008
1 parent 1282912 commit ee0ddad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/mm/vmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int insert_memory_segment(struct memory_segment *seg)
{
struct memory_segment *tmp;

if (seg->start + seg->size >= VMEM_MAX_PHYS ||
if (seg->start + seg->size > VMEM_MAX_PHYS ||
seg->start + seg->size < seg->start)
return -ERANGE;

Expand Down

0 comments on commit ee0ddad

Please sign in to comment.