From e71edd3e1c345b02893337551e5b405f0bdbb716 Mon Sep 17 00:00:00 2001 From: Maria Yu Date: Thu, 9 Dec 2021 20:26:27 +0100 Subject: [PATCH] android: binder: add rate limit for possible excessive log 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 Signed-off-by: engstk --- drivers/android/binder_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 71cc3838f30f..01fca3ca9fec 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include "binder_alloc.h" @@ -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; }