Diff between d2925918b2c449a7ac7f2712437c2cf05a3e80b2 and 44658f11cafb311703783d6e225c020b61fda54f

Changed Files

File Additions Deletions Status
src/shared/gap.c +1 -4 modified

Full Patch

diff --git a/src/shared/gap.c b/src/shared/gap.c
index 4a21e5d..0b8d073 100644
--- a/src/shared/gap.c
+++ b/src/shared/gap.c
@@ -85,7 +85,6 @@ static void read_commands_complete(uint8_t status, uint16_t length,
 	struct bt_gap *gap = user_data;
 	const struct mgmt_rp_read_commands *rp = param;
 	uint16_t num_commands, num_events;
-	const uint16_t *opcode;
 	size_t expected_len;
 	int i;
 
@@ -110,10 +109,8 @@ static void read_commands_complete(uint8_t status, uint16_t length,
 		return;
 	}
 
-	opcode = rp->opcodes;
-
 	for (i = 0; i < num_commands; i++) {
-		uint16_t op = get_le16(opcode++);
+		uint16_t op = get_le16(rp->opcodes + i);
 
 		if (op == MGMT_OP_ADD_DEVICE)
 			gap->flags |= FLAG_MGMT_CONN_CONTROL;