summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-25 16:31:08 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-25 16:31:08 +0200
commit295727e0425b0ac1561883e2a273f65b4b6450a4 (patch)
treee56a295fb63a15095b59e594662c90fd26663763
parentf90d997ac4e6c9afbf46a6d849ff15cad113fe9b (diff)
Fix headset_connect_rfcomm error return case
-rw-r--r--audio/headset.c5
-rw-r--r--audio/manager.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/audio/headset.c b/audio/headset.c
index 7f87dc23..ff4847bb 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -2310,9 +2310,12 @@ int headset_connect_rfcomm(struct audio_device *dev, GIOChannel *io)
{
struct headset *hs = dev->headset;
+ if (hs->tmp_rfcomm)
+ return -EALREADY;
+
hs->tmp_rfcomm = g_io_channel_ref(io);
- return hs->tmp_rfcomm ? 0 : -EINVAL;
+ return 0;
}
int headset_connect_sco(struct audio_device *dev, GIOChannel *io)
diff --git a/audio/manager.c b/audio/manager.c
index 77de2878..964309fd 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -484,7 +484,7 @@ static void ag_confirm(GIOChannel *chan, gpointer data)
set_hfp_active(device, hfp_active);
if (headset_connect_rfcomm(device, chan) < 0) {
- error("Allocating new GIOChannel failed!");
+ error("headset_connect_rfcomm failed");
goto drop;
}