public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Takahasi <claudio.takahasi@openbossa.org>
To: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: [PATCH] Fix segmentation fault when headset disconnects during authorization
Date: Wed, 10 Feb 2010 21:10:55 -0200	[thread overview]
Message-ID: <f9d4bd31002101510y1435f74ev886d7993959990ff@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

Hi guys,

This patch fix a segmentation fault when the headset disconnected
during authorization, see gdb backtrace:
http://pastebin.com/m1529c2dc

Can someone fix avctp now? For this case, answering "yes" in agent
avctp connection will be left open:

bluetoothd[5406]: Headset disconnected during authorization
bluetoothd[5406]: State changed
/org/bluez/5406/hci0/dev_00_15_A0_0F_76_CF: HEADSET_STATE_CONNECTING
-> HEADSET_STATE_DISCONNECTED
bluetoothd[5406]: AVCTP: connected to 00:15:A0:0F:76:CF
bluetoothd[5406]: Can't open input device: No such file or directory (2)
bluetoothd[5406]: AVRCP: failed to init uinput for 00:15:A0:0F:76:CF
bluetoothd[5406]: AVCTP Connected


Regards,
Claudio.

[-- Attachment #2: 0001-Fix-segmentation-fault-when-headset-disconnects-duri.patch --]
[-- Type: application/octet-stream, Size: 936 bytes --]

From 96f640ed18dbf34f0aa739d8fb08c529edfb74ec Mon Sep 17 00:00:00 2001
From: Claudio Takahasi <claudio.takahasi@openbossa.org>
Date: Wed, 10 Feb 2010 12:29:16 -0200
Subject: [PATCH 1/1] Fix segmentation fault when headset disconnects during authorization

Headset authorization callback is not being removed when the headset
disconnects during authorization. Cancel authorization function of
audio devices doesn't iterate the callbacks list properly.
---
 audio/device.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/device.c b/audio/device.c
index b8ea927..76aaddd 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -781,7 +781,7 @@ int audio_device_cancel_authorization(struct audio_device *dev,
 	GSList *l, *next;
 
 	for (l = priv->auths; l != NULL; l = next) {
-		struct service_auth *auth = priv->auths->data;
+		struct service_auth *auth = l->data;
 
 		next = g_slist_next(l);
 
-- 
1.6.6.1


             reply	other threads:[~2010-02-10 23:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 23:10 Claudio Takahasi [this message]
2010-02-11 15:48 ` [PATCH] Fix segmentation fault when headset disconnects during authorization Luiz Augusto von Dentz
2010-02-12  1:38 ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9d4bd31002101510y1435f74ev886d7993959990ff@mail.gmail.com \
    --to=claudio.takahasi@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox