Hi Vinicius, On Fri, Sep 15, 2017 at 3:57 AM, Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx> wrote: > Hi Luiz, > > Luiz Augusto von Dentz <luiz.dentz@xxxxxxxxx> writes: > >> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> >> >> We should not reply until the start discovery completes otherwise >> clients may attempt to stop the discovery before it even has started. >> >> On top of this it will now block clients so they so not be able to >> queue more requests. >> --- >> src/adapter.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- >> 1 file changed, 47 insertions(+), 8 deletions(-) >> >> diff --git a/src/adapter.c b/src/adapter.c >> index a571b1870..4b9f5a1cd 100644 >> --- a/src/adapter.c >> +++ b/src/adapter.c >> @@ -160,6 +160,7 @@ struct discovery_filter { >> >> struct watch_client { >> struct btd_adapter *adapter; >> + DBusMessage *msg; >> char *owner; >> guint watch; >> struct discovery_filter *discovery_filter; >> @@ -1421,13 +1422,17 @@ static void start_discovery_complete(uint8_t status, uint16_t length, >> const void *param, void *user_data) >> { >> struct btd_adapter *adapter = user_data; >> + struct watch_client *client = adapter->discovery_list->data; > > What if the client exits the bus after issuing StartDiscovery(), but > before receiving the reply. It seems that 'adapter->discovery_list' > could be empty, no? Yep, we would have to check if the client has been removed, I will add a check for that. -- Luiz Augusto von Dentzy -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html