[2/2] android: binder: Fix null ptr dereference in debug msg
diff mbox series

Message ID 20171006201206.27073-3-sherryy@android.com
State New, archived
Headers show
Series
  • [1/2] android: binder: Change binder_shrinker to static
Related show

Commit Message

Sherry Yang Oct. 6, 2017, 8:12 p.m. UTC
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>
---
 drivers/android/binder_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kroah-Hartman Oct. 20, 2017, 1:42 p.m. UTC | #1
On Fri, Oct 06, 2017 at 04:12:06PM -0400, Sherry Yang wrote:
> 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>
> ---
>  drivers/android/binder_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Same here, can you rebase and resend this one against char-misc-linus
and resend?

thanks,

greg k-h

Patch
diff mbox series

diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 47e2c032ad3d..6f6f745605af 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -560,7 +560,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);
 	}