Return-Path: From: Claudio Takahasi To: linux-bluetooth@vger.kernel.org Cc: Claudio Takahasi Subject: [PATCH v2 4/5] Fix missing reply when create device is cancelled Date: Mon, 20 Dec 2010 19:47:35 -0300 Message-Id: <1292885255-21662-1-git-send-email-claudio.takahasi@openbossa.org> In-Reply-To: <1292442852-26457-4-git-send-email-claudio.takahasi@openbossa.org> References: <1292442852-26457-4-git-send-email-claudio.takahasi@openbossa.org> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: When CancelDeviceCreation is called or when the device is removed for any reason, the reply for the pending CreateDevice is not sent. --- src/device.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index 33b09eb..b7c7ddf 100644 --- a/src/device.c +++ b/src/device.c @@ -727,8 +727,10 @@ void device_request_disconnect(struct btd_device *device, DBusMessage *msg) if (device->bonding) bonding_request_cancel(device->bonding); - if (device->browse) + if (device->browse) { + discover_services_reply(device->browse, -ECANCELED, NULL); browse_request_cancel(device->browse); + } if (msg) device->disconnects = g_slist_append(device->disconnects, @@ -1040,8 +1042,10 @@ void device_remove(struct btd_device *device, gboolean remove_stored) if (device->bonding) device_cancel_bonding(device, HCI_OE_USER_ENDED_CONNECTION); - if (device->browse) + if (device->browse) { + discover_services_reply(device->browse, -ECANCELED, NULL); browse_request_cancel(device->browse); + } if (device->handle) do_disconnect(device); -- 1.7.3.3