Diff between 3204c443ad57452102783b0fadd682c429e25a1a and c8217dc4624e488e2fcbdb2e40ca162937f8ee25

Changed Files

File Additions Deletions Status
emulator/btdev.c +2 -4 modified

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 7b40699..53c5495 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -850,9 +850,9 @@ static void disconnect_complete(struct btdev *btdev, uint16_t handle,
 							uint8_t reason)
 {
 	struct bt_hci_evt_disconnect_complete dc;
-	struct btdev *remote;
+	struct btdev *remote = btdev->conn;
 
-	if (!btdev) {
+	if (!remote) {
 		dc.status = BT_HCI_ERR_UNKNOWN_CONN_ID;
 		dc.handle = cpu_to_le16(handle);
 		dc.reason = 0x00;
@@ -866,8 +866,6 @@ static void disconnect_complete(struct btdev *btdev, uint16_t handle,
 	dc.handle = cpu_to_le16(handle);
 	dc.reason = reason;
 
-	remote = btdev->conn;
-
 	btdev->conn = NULL;
 	remote->conn = NULL;