diff options
| author | Tiffany Yang <[email protected]> | 2025-07-14 18:53:14 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-07-16 12:11:58 +0000 |
| commit | bea3e7bfa2957d986683543cbf57092715f9a91b (patch) | |
| tree | da5a7dd38339c0449cf3b80f4fb3440c01ab5c10 | |
| parent | binder: use guards for plain mutex- and spinlock-protected sections (diff) | |
| download | kernel-bea3e7bfa2957d986683543cbf57092715f9a91b.tar.gz kernel-bea3e7bfa2957d986683543cbf57092715f9a91b.zip | |
binder: Fix selftest page indexing
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.
Signed-off-by: Tiffany Yang <[email protected]>
Acked-by: Carlos Llamas <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | drivers/android/binder_alloc_selftest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/android/binder_alloc_selftest.c b/drivers/android/binder_alloc_selftest.c index c88735c54848..486af3ec3c02 100644 --- a/drivers/android/binder_alloc_selftest.c +++ b/drivers/android/binder_alloc_selftest.c @@ -142,12 +142,12 @@ 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++) { /** * Error message on a free page can be false positive * if binder shrinker ran during binder_alloc_free_buf * calls above. */ + for (i = 0; i <= (end - 1) / PAGE_SIZE; i++) { if (list_empty(page_to_lru(alloc->pages[i]))) { pr_err_size_seq(sizes, seq); pr_err("expect lru but is %s at page index %d\n", |
