From 7992d0ac0bf94ad71db572668823e236514016f8 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Tue, 14 Feb 2012 12:06:03 -0400 Subject: [PATCH] device: Fix invalid D-Bus calls during Reverse GATT Discovery There is no D-Bus client active during Reverse GATT Discovery, therefore BlueZ should not send any D-Bus replies. This fixes errors reported by D-Bus internal checks: process 453: arguments to dbus_message_new_method_return() were incorrect, assertion "method_call != NULL" failed in file dbus-message.c line 1111. --- src/device.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/device.c b/src/device.c index b5815648b..b410a6399 100644 --- a/src/device.c +++ b/src/device.c @@ -1799,9 +1799,12 @@ static void primary_cb(GSList *services, guint8 status, gpointer user_data) GSList *l, *uuids = NULL; if (status) { - DBusMessage *reply; - reply = btd_error_failed(req->msg, att_ecode2str(status)); - g_dbus_send_message(req->conn, reply); + if (req->msg) { + DBusMessage *reply; + reply = btd_error_failed(req->msg, + att_ecode2str(status)); + g_dbus_send_message(req->conn, reply); + } goto done; } @@ -1821,7 +1824,8 @@ static void primary_cb(GSList *services, guint8 status, gpointer user_data) g_slist_free(uuids); services_changed(device); - create_device_reply(device, req); + if (req->msg) + create_device_reply(device, req); store_services(device); -- 2.47.3