Commit 7ba5715a authored by Szymon Janc's avatar Szymon Janc Committed by Johan Hedberg
Browse files

Bluetooth: Remove double address comparison



set_random_address already checks if current random address needs
to be updated so there is no need to double check that before it
is called.

Change-Id: If5fe16f1b886aa877bf014a8977ccaea2c8ba6e0
Signed-off-by: default avatarSzymon Janc <ext.szymon.janc@tieto.com>
parent 605f7a09
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -485,8 +485,7 @@ static int hci_le_create_conn(const struct bt_conn *conn)
	struct net_buf *buf;
	struct bt_hci_cp_le_create_conn *cp;

	if (conn->le.init_addr.type == BT_ADDR_LE_RANDOM &&
	    bt_addr_le_cmp(&conn->le.init_addr, &bt_dev.random_addr)) {
	if (conn->le.init_addr.type == BT_ADDR_LE_RANDOM) {
		if (set_random_address(&conn->le.init_addr.a)) {
			return -EIO;
		}