+ memblock-fix-memblock_next_valid_pfn.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/memblock.c: fix memblock_next_valid_pfn()
has been added to the -mm tree.  Its filename is
     memblock-fix-memblock_next_valid_pfn.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/memblock-fix-memblock_next_valid_pfn.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/memblock-fix-memblock_next_valid_pfn.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: AKASHI Takahiro <takahiro.akashi@xxxxxxxxxx>
Subject: mm/memblock.c: fix memblock_next_valid_pfn()

Obviously, we should not access memblock.memory.regions[right] if 'right'
is outside of [0..memblock.memory.cnt>.

Fixes: b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible")
Link: http://lkml.kernel.org/r/20170303023745.9104-1-takahiro.akashi@xxxxxxxxxx
Signed-off-by: AKASHI Takahiro <takahiro.akashi@xxxxxxxxxx>
Cc: Paul Burton <paul.burton@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/memblock.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff -puN mm/memblock.c~memblock-fix-memblock_next_valid_pfn mm/memblock.c
--- a/mm/memblock.c~memblock-fix-memblock_next_valid_pfn
+++ a/mm/memblock.c
@@ -1118,7 +1118,10 @@ unsigned long __init_memblock memblock_n
 		}
 	} while (left < right);
 
-	return min(PHYS_PFN(type->regions[right].base), max_pfn);
+	if (right == type->cnt)
+		return max_pfn;
+	else
+		return min(PHYS_PFN(type->regions[right].base), max_pfn);
 }
 
 /**
_

Patches currently in -mm which might be from takahiro.akashi@xxxxxxxxxx are

memblock-fix-memblock_next_valid_pfn.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux