diff options
-rw-r--r-- | src/adapter.c | 2 | ||||
-rw-r--r-- | src/dbus-hci.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/adapter.c b/src/adapter.c index 9a52c6c71..f6aea35b4 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -3195,7 +3195,7 @@ void adapter_free_bonding_request(struct btd_adapter *adapter) struct bonding_request_info *adapter_get_bonding_info(struct btd_adapter *adapter) { - if (!adapter || !adapter->bonding) + if (!adapter) return NULL; return adapter->bonding; diff --git a/src/dbus-hci.c b/src/dbus-hci.c index 7261deaa0..8332fb4db 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -507,7 +507,6 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, struct bonding_request_info *bonding; gboolean paired = TRUE; struct pending_auth_info *auth; - const gchar *dev_path; debug("hcid_dbus_bonding_process_complete: status=%02x", status); @@ -521,10 +520,8 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, bonding = adapter_get_bonding_info(adapter); - if (status) { - if (bonding) - bonding->hci_status = status; - } + if (status && bonding) + bonding->hci_status = status; auth = adapter_find_auth_request(adapter, peer); if (!auth) { @@ -542,6 +539,8 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, device = adapter_get_device(connection, adapter, paddr); if (device) { + const gchar *dev_path; + debug("hcid_dbus_bonding_process_complete: removing temporary flag"); device_set_temporary(device, FALSE); @@ -553,7 +552,6 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, } proceed: - bonding = adapter_get_bonding_info(adapter); if (!bonding || bacmp(&bonding->bdaddr, peer)) return; /* skip: no bonding req pending */ |