* [PATCH BlueZ] core: Fix not forwarding errors caused by SDP search properly
@ 2013-10-21 13:04 Luiz Augusto von Dentz
2013-10-21 13:26 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2013-10-21 13:04 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
In case bt_search_service fails while processing (e.g. connection is
dropped) the error forward is a positive value leading
btd_service_connecting_complete to not change any state at all.
Futhermore the error from sdp_process was completely ignored which may
cause problems as well.
---
src/sdp-client.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/sdp-client.c b/src/sdp-client.c
index 2789db6..1221f5e 100644
--- a/src/sdp-client.c
+++ b/src/sdp-client.c
@@ -196,14 +196,15 @@ static gboolean search_process_cb(GIOChannel *chan, GIOCondition cond,
gpointer user_data)
{
struct search_context *ctxt = user_data;
- int err = 0;
+ int err;
if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
- err = EIO;
+ err = -EIO;
goto failed;
}
- if (sdp_process(ctxt->session) < 0)
+ err = sdp_process(ctxt->session);
+ if (err < 0)
goto failed;
return TRUE;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-21 13:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 13:04 [PATCH BlueZ] core: Fix not forwarding errors caused by SDP search properly Luiz Augusto von Dentz
2013-10-21 13:26 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox