linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sherry Yang <sherryy@android.com>
To: linux-kernel@vger.kernel.org
Cc: tkjos@google.com, maco@google.com,
	"Sherry Yang" <sherryy@android.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Riley Andrews" <riandrews@android.com>,
	devel@driverdev.osuosl.org (open list:ANDROID DRIVERS)
Subject: [PATCH 2/2] android: binder: Fix null ptr dereference in debug msg
Date: Fri,  6 Oct 2017 16:12:06 -0400	[thread overview]
Message-ID: <20171006201206.27073-3-sherryy@android.com> (raw)
In-Reply-To: <20171006201206.27073-1-sherryy@android.com>

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(-)

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);
 	}
-- 
2.11.0 (Apple Git-81)

  parent reply	other threads:[~2017-10-06 20:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-16  5:11 [PATCH 0/2] android: binder: resolve lru, dentry and task deadlock Sherry Yang
2017-09-16  5:11 ` [PATCH 1/2] android: binder: Remove unused vma argument Sherry Yang
2017-09-16  5:11 ` [PATCH 2/2] android: binder: Don't get mm from task Sherry Yang
2017-10-06 20:12   ` Make binder shrinker static and fix null dereference Sherry Yang
2017-10-06 20:12     ` [PATCH 1/2] android: binder: Change binder_shrinker to static Sherry Yang
2017-10-06 20:12     ` Sherry Yang [this message]
2017-10-20 13:42       ` [PATCH 2/2] android: binder: Fix null ptr dereference in debug msg Greg Kroah-Hartman
2017-10-20 13:41   ` [PATCH 2/2] android: binder: Don't get mm from task Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171006201206.27073-3-sherryy@android.com \
    --to=sherryy@android.com \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@google.com \
    --cc=riandrews@android.com \
    --cc=tkjos@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).