Skip to content

Commit

Permalink
android: binder: add rate limit for possible excessive log
Browse files Browse the repository at this point in the history
Got a device crash when there is exessive log of below:
"binder_alloc_buf failed to map pages in userspace, no vma".
So add printk rate limit for fix this.

Signed-off-by: Maria Yu <[email protected]>
Signed-off-by: engstk <[email protected]>
  • Loading branch information
sixtaku authored and engstk committed Jul 18, 2022
1 parent 3699c49 commit e71edd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/android/binder_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/list_lru.h>
#include <linux/ratelimit.h>
#include <linux/uaccess.h>
#include <linux/highmem.h>
#include "binder_alloc.h"
Expand Down Expand Up @@ -224,7 +225,7 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
}

if (!vma && need_mm) {
pr_err("%d: binder_alloc_buf failed to map pages in userspace, no vma\n",
pr_err_ratelimited("%d: binder_alloc_buf failed to map pages in userspace, no vma\n",
alloc->pid);
goto err_no_vma;
}
Expand Down

0 comments on commit e71edd3

Please sign in to comment.