Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753439AbaBTKfL (ORCPT ); Thu, 20 Feb 2014 05:35:11 -0500 Received: from mga14.intel.com ([143.182.124.37]:48586 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbaBTKfK (ORCPT ); Thu, 20 Feb 2014 05:35:10 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,512,1389772800"; d="scan'208,223";a="412316373" From: "Compostella\, Jeremy" To: devel@driverdev.osuosl.org, "Greg Kroah-Hartman" , Subject: [PATCH] Android / binder: Fix broken walk in binder_node_release() CC: "Gross, Mark" , "Ernst, Eric" , "Arve" Date: Thu, 20 Feb 2014 11:35:04 +0100 Message-ID: <87eh2yxeav.fsf@tldlab276.tl.intel.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGksCgpJJ3ZlIGZvdW5kIGEgYnVnIGluIHRoZSBiaW5kZXIgZHJpdmVyIGFuZCBJIHByb3Bvc2Ug dGhlIGF0dGFjaGVkIHBhdGNoIHRvIGZpeAppdC4gIFRoaXMgYnVnIGNvdWxkIG1hbmlmZXN0IGl0 c2VsZiBpbiBzZXZlcmFsIHNpdHVhdGlvbnMsIGhlcmUgaXMgdGhlIG9uZSB0aGF0Cm1hZGUgbWUg aHVudCBpdCBsYXN0IHdlZWsuCgpXaGVuIGFuIEFuZHJvaWQgZGV2aWNlIGlzIGVuY3J5cHRlZCwg QW5kcm9pZCBzdGFydHMgYWxsIHRoZSBpbml0IHNlcnZpY2VzIG9mCmNvcmUgYW5kIG1haW4gbGV2 ZWxzLCB0aGVuIGl0IGFza3MgZm9yIHRoZSBwYXNzd29yZCBhbmQgY2hlY2tzIGl0IHRyeWluZyB0 b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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tCkludGVsIENvcnBvcmF0aW9uIFNBUyAoRnJlbmNoIHNpbXBsaWZpZWQgam9pbnQg c3RvY2sgY29tcGFueSkKUmVnaXN0ZXJlZCBoZWFkcXVhcnRlcnM6ICJMZXMgTW9udGFsZXRzIi0g MiwgcnVlIGRlIFBhcmlzLCAKOTIxOTYgTWV1ZG9uIENlZGV4LCBGcmFuY2UKUmVnaXN0cmF0aW9u IE51bWJlcjogIDMwMiA0NTYgMTk5IFIuQy5TLiBOQU5URVJSRQpDYXBpdGFsOiA0LDU3MiwwMDAg RXVyb3MKClRoaXMgZS1tYWlsIGFuZCBhbnkgYXR0YWNobWVudHMgbWF5IGNvbnRhaW4gY29uZmlk ZW50aWFsIG1hdGVyaWFsIGZvcgp0aGUgc29sZSB1c2Ugb2YgdGhlIGludGVuZGVkIHJlY2lwaWVu dChzKS4gQW55IHJldmlldyBvciBkaXN0cmlidXRpb24KYnkgb3RoZXJzIGlzIHN0cmljdGx5IHBy b2hpYml0ZWQuIElmIHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZApyZWNpcGllbnQsIHBsZWFzZSBj b250YWN0IHRoZSBzZW5kZXIgYW5kIGRlbGV0ZSBhbGwgY29waWVzLgo= --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Android-binder-Fix-broken-walk-in-binder_node_releas.patch Content-Description: [PATCH] Android / binder: Fix broken walk in binder_node_release() >From eaf6a8f28f02220ef2154c76a5345f6aa582e8f7 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Tue, 11 Feb 2014 19:40:29 +0100 Subject: [PATCH] Android / binder: Fix broken walk in binder_node_release() Fix an issue introduced by commit 008fa749e0fe5b2fffd20b7fe4891bb80d072c6a ("drivers: android: binder: Move the node release code to a separate function") which move and rework some code from binder_deferred_release to the binder_node_release new function. The rework introduced an unfortunate break of the loop that prevent some death notifications to be sent. Signed-off-by: Jeremy Compostella --- drivers/staging/android/binder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index eaec1da..1432d95 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -2904,7 +2904,7 @@ static int binder_node_release(struct binder_node *node, int refs) refs++; if (!ref->death) - goto out; + continue; death++; @@ -2917,7 +2917,6 @@ static int binder_node_release(struct binder_node *node, int refs) BUG(); } -out: binder_debug(BINDER_DEBUG_DEAD_BINDER, "node %d now dead, refs %d, death %d\n", node->debug_id, refs, death); -- 1.7.10.4 --=-=-=-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/