From 6ddae194592451d604726a286f566d0246aef567 Mon Sep 17 00:00:00 2001 From: Christian Hoff Date: Mon, 8 Mar 2021 21:23:59 +0100 Subject: [PATCH] Another compile fix for kernel >= 5.8 With kernel 5.8, the return value of map_kernel_range_noflush() was changed. This function now returns 0 on success (instead of the number of successfully mapped pages). This commit adjusts binder accordingly. --- binder/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binder/binder.c b/binder/binder.c index 1814084..aaac689 100644 --- a/binder/binder.c +++ b/binder/binder.c @@ -671,7 +671,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, PAGE_SIZE, PAGE_KERNEL, page); flush_cache_vmap((unsigned long)page_addr, (unsigned long)page_addr + PAGE_SIZE); - if (ret != 1) { + if (ret < 0) { pr_err("%d: binder_alloc_buf failed to map page at %p in kernel\n", proc->pid, page_addr); goto err_map_kernel_failed;