summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-service.c')
-rw-r--r--hcid/dbus-service.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index edb3ab0c..66575d33 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -102,7 +102,11 @@ int service_req_auth(const bdaddr_t *src, const bdaddr_t *dst,
if (!device)
return -EPERM;
- agent = (device->agent ? : adapter->agent);
+ agent = device_get_agent(device);
+
+ if (!agent)
+ agent = adapter->agent;
+
if (!agent)
return -EPERM;
@@ -138,7 +142,11 @@ int service_cancel_auth(const bdaddr_t *src, const bdaddr_t *dst)
* agent and in the meanwhile CreatePairedDevice is called.
*/
- agent = (device->agent ? : adapter->agent);
+ agent = device_get_agent(device);
+
+ if (!agent)
+ agent = adapter->agent;
+
if (!agent)
return -EPERM;