linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Fix crash when disconnecting the a2dp
@ 2011-08-10 18:44 Syam Sidhardhan
  2011-08-10 18:44 ` [PATCH 2/2] gdbus: Remove reduntant copy of GSList* from function Syam Sidhardhan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Syam Sidhardhan @ 2011-08-10 18:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Syam Sidhardhan

When we disconnect the a2dp Headset by immediate power off and soon if we
initiate a disconnection from our side, a crash is occurring. This is
happening because of the disconnect_timeout coming after freeing the session.
---
 audio/avdtp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/avdtp.c b/audio/avdtp.c
index 76526b6..d8d9d7e 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -690,7 +690,7 @@ static void set_disconnect_timer(struct avdtp *session)
 		remove_disconnect_timer(session);
 
 	if (session->device_disconnect) {
-		g_idle_add(disconnect_timeout, session);
+		session->dc_timer = g_idle_add(disconnect_timeout, session);
 		return;
 	}
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gdbus: Remove reduntant copy of GSList* from function
  2011-08-10 18:44 [PATCH 1/2] Fix crash when disconnecting the a2dp Syam Sidhardhan
@ 2011-08-10 18:44 ` Syam Sidhardhan
  2011-08-11  8:26 ` [PATCH 1/2] Fix crash when disconnecting the a2dp Luiz Augusto von Dentz
  2011-08-12  8:01 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Syam Sidhardhan @ 2011-08-10 18:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Syam Sidhardhan

Local copy of the pointer to list is not required, because these
functions already has a copy, through the arguments.
---
 gdbus/object.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/gdbus/object.c b/gdbus/object.c
index 8bc12f5..dafb6b5 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -399,15 +399,13 @@ static void generic_unregister(DBusConnection *connection, void *user_data)
 	g_free(data);
 }
 
-static struct interface_data *find_interface(GSList *interfaces,
+static struct interface_data *find_interface(GSList *list,
 						const char *name)
 {
-	GSList *list;
-
 	if (name == NULL)
 		return NULL;
 
-	for (list = interfaces; list; list = list->next) {
+	for (; list; list = list->next) {
 		struct interface_data *iface = list->data;
 		if (!strcmp(name, iface->name))
 			return iface;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Fix crash when disconnecting the a2dp
  2011-08-10 18:44 [PATCH 1/2] Fix crash when disconnecting the a2dp Syam Sidhardhan
  2011-08-10 18:44 ` [PATCH 2/2] gdbus: Remove reduntant copy of GSList* from function Syam Sidhardhan
@ 2011-08-11  8:26 ` Luiz Augusto von Dentz
  2011-08-12  8:01 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-08-11  8:26 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth

Hi,

On Wed, Aug 10, 2011 at 9:44 PM, Syam Sidhardhan <syamsidhardh@gmail.com> wrote:
> When we disconnect the a2dp Headset by immediate power off and soon if we
> initiate a disconnection from our side, a crash is occurring. This is
> happening because of the disconnect_timeout coming after freeing the session.
> ---
>  audio/avdtp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/audio/avdtp.c b/audio/avdtp.c
> index 76526b6..d8d9d7e 100644
> --- a/audio/avdtp.c
> +++ b/audio/avdtp.c
> @@ -690,7 +690,7 @@ static void set_disconnect_timer(struct avdtp *session)
>                remove_disconnect_timer(session);
>
>        if (session->device_disconnect) {
> -               g_idle_add(disconnect_timeout, session);
> +               session->dc_timer = g_idle_add(disconnect_timeout, session);
>                return;
>        }
>

Nice catch, ack.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Fix crash when disconnecting the a2dp
  2011-08-10 18:44 [PATCH 1/2] Fix crash when disconnecting the a2dp Syam Sidhardhan
  2011-08-10 18:44 ` [PATCH 2/2] gdbus: Remove reduntant copy of GSList* from function Syam Sidhardhan
  2011-08-11  8:26 ` [PATCH 1/2] Fix crash when disconnecting the a2dp Luiz Augusto von Dentz
@ 2011-08-12  8:01 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-08-12  8:01 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth

Hi Syam,

On Thu, Aug 11, 2011, Syam Sidhardhan wrote:
> When we disconnect the a2dp Headset by immediate power off and soon if we
> initiate a disconnection from our side, a crash is occurring. This is
> happening because of the disconnect_timeout coming after freeing the session.
> ---
>  audio/avdtp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied (after reformatting the commit message to max 74 characters;
please do this yourself in the future). Again, I left the second patch
out since I'm doubtful it helps more than it hurts readability.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-12  8:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-10 18:44 [PATCH 1/2] Fix crash when disconnecting the a2dp Syam Sidhardhan
2011-08-10 18:44 ` [PATCH 2/2] gdbus: Remove reduntant copy of GSList* from function Syam Sidhardhan
2011-08-11  8:26 ` [PATCH 1/2] Fix crash when disconnecting the a2dp Luiz Augusto von Dentz
2011-08-12  8:01 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).