From 295727e0425b0ac1561883e2a273f65b4b6450a4 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 25 Feb 2009 16:31:08 +0200 Subject: Fix headset_connect_rfcomm error return case --- audio/headset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'audio/headset.c') 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) -- cgit