The binder allocator selftest was only checking the last page of buffers
that ended on a page boundary. Correct the page indexing to account for
buffers that are not page-aligned.

Acked-by: Carlos Llamas <cmlla...@google.com>
Signed-off-by: Tiffany Yang <ynaf...@google.com>
---
v4:
* Fixed unaligned comment
* Collected tags
---
 drivers/android/binder_alloc_selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder_alloc_selftest.c 
b/drivers/android/binder_alloc_selftest.c
index c88735c54848..de5bd848d042 100644
--- a/drivers/android/binder_alloc_selftest.c
+++ b/drivers/android/binder_alloc_selftest.c
@@ -142,7 +142,7 @@ static void binder_selftest_free_buf(struct binder_alloc 
*alloc,
        for (i = 0; i < BUFFER_NUM; i++)
                binder_alloc_free_buf(alloc, buffers[seq[i]]);
 
-       for (i = 0; i < end / PAGE_SIZE; i++) {
+       for (i = 0; i <= (end - 1) / PAGE_SIZE; i++) {
                /**
                 * Error message on a free page can be false positive
                 * if binder shrinker ran during binder_alloc_free_buf
-- 
2.50.0.727.gbf7dc18ff4-goog


Reply via email to