* [PATCH BlueZ 1/2] android/hal-audio: Fix not closing audio_sk @ 2014-01-20 12:25 Luiz Augusto von Dentz 2014-01-20 12:25 ` [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister Luiz Augusto von Dentz 0 siblings, 1 reply; 3+ messages in thread From: Luiz Augusto von Dentz @ 2014-01-20 12:25 UTC (permalink / raw) To: linux-bluetooth From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> shutdown will only disconnect the peers but it is still needed to close the file descriptor. --- android/hal-audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/hal-audio.c b/android/hal-audio.c index 2f6f8c2..0b4577e 100644 --- a/android/hal-audio.c +++ b/android/hal-audio.c @@ -246,6 +246,7 @@ static void audio_ipc_cleanup(void) { if (audio_sk >= 0) { shutdown(audio_sk, SHUT_RDWR); + close(audio_sk); audio_sk = -1; } } @@ -1090,6 +1091,7 @@ static void *ipc_handler(void *data) if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) { info("Audio HAL: Socket closed"); + close(audio_sk); audio_sk = -1; } -- 1.8.4.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister 2014-01-20 12:25 [PATCH BlueZ 1/2] android/hal-audio: Fix not closing audio_sk Luiz Augusto von Dentz @ 2014-01-20 12:25 ` Luiz Augusto von Dentz 2014-01-21 11:41 ` Luiz Augusto von Dentz 0 siblings, 1 reply; 3+ messages in thread From: Luiz Augusto von Dentz @ 2014-01-20 12:25 UTC (permalink / raw) To: linux-bluetooth From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> At this point IPC might have been closed already. --- android/a2dp.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/android/a2dp.c b/android/a2dp.c index 8ec03c8..5569691 100644 --- a/android/a2dp.c +++ b/android/a2dp.c @@ -119,8 +119,10 @@ static void unregister_endpoint(void *data) g_free(endpoint); } -static void a2dp_device_free(struct a2dp_device *dev) +static void a2dp_device_free(void *data) { + struct a2dp_device *dev = data; + if (dev->idle_id > 0) g_source_remove(dev->idle_id); @@ -1471,13 +1473,6 @@ fail: return false; } -static void a2dp_device_disconnected(gpointer data, gpointer user_data) -{ - struct a2dp_device *dev = data; - - bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED); -} - void bt_a2dp_unregister(void) { DBG(""); @@ -1488,7 +1483,7 @@ void bt_a2dp_unregister(void) g_slist_free_full(endpoints, unregister_endpoint); endpoints = NULL; - g_slist_foreach(devices, a2dp_device_disconnected, NULL); + g_slist_free_full(devices, a2dp_device_free); devices = NULL; ipc_unregister(HAL_SERVICE_ID_A2DP); -- 1.8.4.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister 2014-01-20 12:25 ` [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister Luiz Augusto von Dentz @ 2014-01-21 11:41 ` Luiz Augusto von Dentz 0 siblings, 0 replies; 3+ messages in thread From: Luiz Augusto von Dentz @ 2014-01-21 11:41 UTC (permalink / raw) To: linux-bluetooth@vger.kernel.org Hi, On Mon, Jan 20, 2014 at 2:25 PM, Luiz Augusto von Dentz <luiz.dentz@gmail.com> wrote: > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> > > At this point IPC might have been closed already. > --- > android/a2dp.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/android/a2dp.c b/android/a2dp.c > index 8ec03c8..5569691 100644 > --- a/android/a2dp.c > +++ b/android/a2dp.c > @@ -119,8 +119,10 @@ static void unregister_endpoint(void *data) > g_free(endpoint); > } > > -static void a2dp_device_free(struct a2dp_device *dev) > +static void a2dp_device_free(void *data) > { > + struct a2dp_device *dev = data; > + > if (dev->idle_id > 0) > g_source_remove(dev->idle_id); > > @@ -1471,13 +1473,6 @@ fail: > return false; > } > > -static void a2dp_device_disconnected(gpointer data, gpointer user_data) > -{ > - struct a2dp_device *dev = data; > - > - bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED); > -} > - > void bt_a2dp_unregister(void) > { > DBG(""); > @@ -1488,7 +1483,7 @@ void bt_a2dp_unregister(void) > g_slist_free_full(endpoints, unregister_endpoint); > endpoints = NULL; > > - g_slist_foreach(devices, a2dp_device_disconnected, NULL); > + g_slist_free_full(devices, a2dp_device_free); > devices = NULL; > > ipc_unregister(HAL_SERVICE_ID_A2DP); > -- > 1.8.4.2 Applied, patch 1/2 will need some changes so it is not applied yet. -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-21 11:41 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-01-20 12:25 [PATCH BlueZ 1/2] android/hal-audio: Fix not closing audio_sk Luiz Augusto von Dentz 2014-01-20 12:25 ` [PATCH BlueZ 2/2] android/A2DP: Fix sending notification on bt_a2dp_unregister Luiz Augusto von Dentz 2014-01-21 11:41 ` Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox