public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Riley Andrews <riandrews@android.com>
Cc: linux-kernel@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	devel@driverdev.osuosl.org
Subject: Re: [PATCH 03/13] android: binder: refactor binder_thread_write
Date: Fri, 29 May 2015 13:06:21 +0300	[thread overview]
Message-ID: <20150529100621.GG28762@mwanda> (raw)
In-Reply-To: <1432854511-33320-4-git-send-email-riandrews@android.com>

This patch is ok.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

On Thu, May 28, 2015 at 04:08:21PM -0700, Riley Andrews wrote:
> +static void binder_call_inc_dec_ref(struct binder_thread *thread,
> +				    uint32_t target, uint32_t cmd)
> +{
> +	struct binder_proc *proc = thread->proc;
> +	struct binder_ref *ref;
> +	const char *debug_string;
> +
> +	if (target == 0 && binder_context_mgr_node &&
> +	    (cmd == BC_INCREFS || cmd == BC_ACQUIRE)) {
> +		ref = binder_get_ref_for_node(proc, binder_context_mgr_node);
> +		if (ref->desc != target) {
> +			binder_user_error("%d:%d tried to acquire reference to desc 0, got %d instead\n",
> +					  proc->pid, thread->pid, ref->desc);
> +			return;

Presumably we never hit this error condition.  In the original code we
printed an error and continued but now we bail on error.  Presumably
this is a theoretical bug fix which doesn't affect real life so I will
allow it.  But in the future don't mix behaviour changes with clean up
patches.

> +		}
> +	} else {
> +		ref = binder_get_ref(proc, target);
> +	}
> +	if (!ref) {

In the original code this was "if (ref == NULL)".  Please don't mix
these kinds of cleanups with moving code around because it makes it
harder for me to review.  Do that in a separate patch.

regards,
dan carpenter


  reply	other threads:[~2015-05-29 10:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 23:08 [PATCH 0/13] Binder driver refactor and minor bug fixes Riley Andrews
2015-05-28 23:08 ` [PATCH 01/13] drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE Riley Andrews
2015-05-29  9:23   ` Dan Carpenter
2015-05-28 23:08 ` [PATCH 02/13] android: binder: fix duplicate error return Riley Andrews
2015-05-28 23:08 ` [PATCH 03/13] android: binder: refactor binder_thread_write Riley Andrews
2015-05-29 10:06   ` Dan Carpenter [this message]
2015-05-28 23:08 ` [PATCH 04/13] android: binder: refactor binder_transact handle translation Riley Andrews
2015-05-28 23:08 ` [PATCH 05/13] android: binder: refactor binder_transact transaction buffer loop Riley Andrews
2015-05-29 10:25   ` Dan Carpenter
2015-05-28 23:08 ` [PATCH 06/13] android: binder: add function to find target binder node Riley Andrews
2015-05-28 23:08 ` [PATCH 07/13] android: binder: add functions for manipulating transaction stack Riley Andrews
2015-05-28 23:08 ` [PATCH 08/13] android: binder: add function for logging failed transactions Riley Andrews
2015-05-28 23:08 ` [PATCH 09/13] android: binder: add function for finding prior thread in transaction stack Riley Andrews
2015-05-28 23:08 ` [PATCH 10/13] android: binder: refactor binder_thread_read loop Riley Andrews
2015-05-28 23:08 ` [PATCH 11/13] android: binder: add function to handle waiting for binder_thread_read Riley Andrews
2015-05-28 23:08 ` [PATCH 12/13] android: binder: add function to pass thread errors to userspace Riley Andrews
2015-05-28 23:08 ` [PATCH 13/13] android: binder: add function for processing work nodes in binder_thread_read Riley Andrews
2015-05-29 11:56   ` Dan Carpenter

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=20150529100621.GG28762@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riandrews@android.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