Skip to content

Commit ae65c85

Browse files
Sherry Yanggregkh
authored andcommitted
android: binder: Fix null ptr dereference in debug msg
Don't access next->data in kernel debug message when the next buffer is null. Acked-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Sherry Yang <sherryy@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a0c2baa commit ae65c85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/android/binder_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static void binder_delete_free_buffer(struct binder_alloc *alloc,
560560
binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC,
561561
"%d: merge free, buffer %pK do not share page with %pK or %pK\n",
562562
alloc->pid, buffer->data,
563-
prev->data, next->data);
563+
prev->data, next ? next->data : NULL);
564564
binder_update_page_range(alloc, 0, buffer_start_page(buffer),
565565
buffer_start_page(buffer) + PAGE_SIZE,
566566
NULL);

0 commit comments

Comments
 (0)