summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-06 01:08:57 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-06 01:08:57 +0200
commit76f7d0008dc16f327b998b22c0bea9510ccc2666 (patch)
tree5c1fa39b9b2e23af1eed73e0539e600320a56b09 /audio
parent016eb60f4560b9278c2bf096fc0fc8d62c6035f4 (diff)
Fix D-Bus method return creation logic in hfp_slc_complete()
Diffstat (limited to 'audio')
-rw-r--r--audio/headset.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/audio/headset.c b/audio/headset.c
index f7cc9ecf..7d227a7b 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -538,20 +538,22 @@ static void hfp_slc_complete(struct audio_device *dev)
if (p == NULL)
return;
- if (p->msg) {
- DBusMessage *reply = dbus_message_new_method_return(p->msg);
- dbus_connection_send(dev->conn, reply, NULL);
- dbus_message_unref(reply);
- }
-
if (p->target_state == HEADSET_STATE_CONNECTED) {
+ if (p->msg) {
+ DBusMessage *reply = dbus_message_new_method_return(p->msg);
+ dbus_connection_send(dev->conn, reply, NULL);
+ dbus_message_unref(reply);
+ }
pending_connect_finalize(dev);
return;
}
p->err = sco_connect(dev, NULL, NULL, NULL);
- if (p->err < 0)
+ if (p->err < 0) {
+ if (p->msg)
+ error_connection_attempt_failed(dev->conn, p->msg, p->err);
pending_connect_finalize(dev);
+ }
}
static int telephony_generic_rsp(struct audio_device *device, cme_error_t err)