From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 1/2] core: Fix not replying to DisconnectProfile
Date: Tue, 10 Dec 2013 10:41:16 +0200 [thread overview]
Message-ID: <1386664877-10137-1-git-send-email-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
btd_service_disconnect may cause a service to disconnect before returning
which cause dev->disconnect to be set after device_profile_disconnected.
---
src/device.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/device.c b/src/device.c
index d7a00ec..953a338 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1434,11 +1434,14 @@ static DBusMessage *disconnect_profile(DBusConnection *conn, DBusMessage *msg,
if (!service)
return btd_error_invalid_args(msg);
+ dev->disconnect = dbus_message_ref(msg);
+
err = btd_service_disconnect(service);
- if (err == 0) {
- dev->disconnect = dbus_message_ref(msg);
+ if (err == 0)
return NULL;
- }
+
+ dbus_message_unref(dev->disconnect);
+ dev->disconnect = NULL;
if (err == -ENOTSUP)
return btd_error_not_supported(msg);
--
1.8.3.1
next reply other threads:[~2013-12-10 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 8:41 Luiz Augusto von Dentz [this message]
2013-12-10 8:41 ` [PATCH BlueZ 2/2] core: Fix leaking disconnect message Luiz Augusto von Dentz
2013-12-10 9:32 ` [PATCH BlueZ 1/2] core: Fix not replying to DisconnectProfile 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=1386664877-10137-1-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).