Return-Path: From: Peter Hurley To: Jaikumar Ganesh CC: "linux-bluetooth@vger.kernel.org" Date: Thu, 4 Aug 2011 12:13:00 -0400 Subject: Re: [PATCH] Bluetooth: bnep: Fix deadlock in session deletion. Message-ID: <1312474380.2158.21.camel@THOR> References: <1312423146-99276-1-git-send-email-jaikumar@google.com> In-Reply-To: <1312423146-99276-1-git-send-email-jaikumar@google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: T24gV2VkLCAyMDExLTA4LTAzIGF0IDIxOjU5IC0wNDAwLCBKYWlrdW1hciBHYW5lc2ggd3JvdGU6 DQo+IENvbW1pdCBmNGQ3Y2Q0YTRjMjVjYjRhNWMzMGE2NzVkNGNjMDA1MmM5M2I5MjVhIGludHJv ZHVjZWQNCj4gdXNhZ2Ugb2YgPGxpbnV4L2t0aHJlYWQuaD4gQVBJLiBrdGhyZWFkX3N0b3AgaXMg YSBibG9ja2luZw0KPiBmdW5jdGlvbiB3aGljaCByZXR1cm5zIG9ubHkgd2hlbiB0aGUgdGhyZWFk IGV4aXRzLiBJbiB0aGlzDQo+IGNhc2UsIHRoZSB0aHJlYWQgY291bGRuJ3QgZXhpdCBiZWNhdXNl IGl0IHdhcyB3YWl0aW5nIHRvIGdldA0KPiBhIHdyaXRlIHNlbWFwaG9yZS4gYm5lcF9kZWxfY29u bmVjdGlvbiBmdW5jdGlvbiB3aGljaCBjYWxscw0KPiBrdGhyZWFkX3N0b3AgYWxzbyBoZWxkIHRo ZSByZWFkIHNlbWFwaG9yZS4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IEphaWt1bWFyIEdhbmVzaCA8 amFpa3VtYXJAZ29vZ2xlLmNvbT4NCj4gLS0tDQo+ICBuZXQvYmx1ZXRvb3RoL2JuZXAvY29yZS5j IHwgICA0NyArKysrKysrKysrKysrKysrKysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tLQ0KPiAg MSBmaWxlcyBjaGFuZ2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