* [PATCH] fix the bug introduced by commit "re-use the sco_server initiated by audio plugin"
@ 2009-06-19 5:30 Forrest Zhao
2009-06-19 13:01 ` Johan Hedberg
2009-06-19 15:38 ` Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Forrest Zhao @ 2009-06-19 5:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Forrest Zhao
---
audio/gateway.c | 3 ---
audio/main.c | 4 ++++
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/audio/gateway.c b/audio/gateway.c
index a170bec..607a4a0 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -1079,9 +1079,6 @@ int gateway_connect_sco(struct audio_device *dev, GIOChannel *io)
{
struct gateway *gw = dev->gateway;
- if (gw->sco)
- return -EISCONN;
-
gw->sco = g_io_channel_ref(io);
return 0;
diff --git a/audio/main.c b/audio/main.c
index 4e5eda2..cf16fd4 100644
--- a/audio/main.c
+++ b/audio/main.c
@@ -93,6 +93,10 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
device = manager_find_device(NULL, &src, &dst, AUDIO_HEADSET_INTERFACE,
FALSE);
if (!device)
+ device = manager_find_device(NULL, &src, &dst,
+ AUDIO_GATEWAY_INTERFACE, FALSE);
+
+ if (!device)
goto drop;
if (device->headset) {
--
1.5.4.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fix the bug introduced by commit "re-use the sco_server initiated by audio plugin"
2009-06-19 5:30 [PATCH] fix the bug introduced by commit "re-use the sco_server initiated by audio plugin" Forrest Zhao
@ 2009-06-19 13:01 ` Johan Hedberg
2009-06-19 15:38 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2009-06-19 13:01 UTC (permalink / raw)
To: Forrest Zhao; +Cc: linux-bluetooth
Hi Forrest,
On Fri, Jun 19, 2009, Forrest Zhao wrote:
> @@ -1079,9 +1079,6 @@ int gateway_connect_sco(struct audio_device *dev, GIOChannel *io)
> {
> struct gateway *gw = dev->gateway;
>
> - if (gw->sco)
> - return -EISCONN;
> -
> gw->sco = g_io_channel_ref(io);
This part looks wrong. If gw->sco is non-NULL you'd be causing a memory
leak. Why do you think that returning -EISCONN is wrong here?
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix the bug introduced by commit "re-use the sco_server initiated by audio plugin"
2009-06-19 5:30 [PATCH] fix the bug introduced by commit "re-use the sco_server initiated by audio plugin" Forrest Zhao
2009-06-19 13:01 ` Johan Hedberg
@ 2009-06-19 15:38 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2009-06-19 15:38 UTC (permalink / raw)
To: Forrest Zhao; +Cc: linux-bluetooth
Hi Forrest,
On Fri, Jun 19, 2009, Forrest Zhao wrote:
> --- a/audio/main.c
> +++ b/audio/main.c
> @@ -93,6 +93,10 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
> device = manager_find_device(NULL, &src, &dst, AUDIO_HEADSET_INTERFACE,
> FALSE);
> if (!device)
> + device = manager_find_device(NULL, &src, &dst,
> + AUDIO_GATEWAY_INTERFACE, FALSE);
> +
> + if (!device)
> goto drop;
I went ahead and commited this second part of your patch since it looks
correct and is good too have in before the next release (due out today).
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-19 15:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-19 5:30 [PATCH] fix the bug introduced by commit "re-use the sco_server initiated by audio plugin" Forrest Zhao
2009-06-19 13:01 ` Johan Hedberg
2009-06-19 15:38 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox