aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSherry Yang <sherryy@android.com>2017-10-05 17:13:47 -0400
committerTodd Kjos <tkjos@google.com>2017-12-15 12:57:55 -0800
commit845e5019650c3a7fd4386c6cac8bdc06af78c4c6 (patch)
treeff57b72227e6a5284aae739a080b66c99677fab4
parent9c028844243bbeb80be23480175dc54b87b09fc7 (diff)
FROMLIST: android: binder: Fix null ptr dereference in debug msgASB-2017-12-05_3.18-o-release
(from https://patchwork.kernel.org/patch/9990323/) Don't access next->data in kernel debug message when the next buffer is null. Bug: 36007193 Change-Id: Ib8240d7e9a7087a2256e88c0ae84b9df0f2d0224 Acked-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Sherry Yang <sherryy@android.com>
-rw-r--r--drivers/staging/android/binder_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/android/binder_alloc.c b/drivers/staging/android/binder_alloc.c
index a5ec9709fc54..2fbb705d4b50 100644
--- a/drivers/staging/android/binder_alloc.c
+++ b/drivers/staging/android/binder_alloc.c
@@ -561,7 +561,7 @@ static void binder_delete_free_buffer(struct binder_alloc *alloc,
binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: merge free, buffer %pK do not share page with %pK or %pK\n",
alloc->pid, buffer->data,
- prev->data, next->data);
+ prev->data, next ? next->data : NULL);
binder_update_page_range(alloc, 0, buffer_start_page(buffer),
buffer_start_page(buffer) + PAGE_SIZE);
}