Return a D-Bus error if device_browse fails
If Discover All Primary Services or SDP search fails, the CreateDevice
caller will not receive a response. Error reproducible when a Discover
All Primary Services is sent over a LE link and the kernel doesn't
address properly the connections in the channel ID 4.
diff --git a/src/adapter.c b/src/adapter.c
index 8d5df65..999f369 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1694,6 +1694,7 @@
struct remote_dev_info *dev, match;
const gchar *address;
gboolean le;
+ int err;
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &address,
DBUS_TYPE_INVALID) == FALSE)
@@ -1720,7 +1721,9 @@
if (!device)
return NULL;
- device_browse(device, conn, msg, NULL, FALSE);
+ err = device_browse(device, conn, msg, NULL, FALSE);
+ if (err < 0)
+ return failed_strerror(msg, -err);
return NULL;
}