Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eec7a01d authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann
Browse files

Bluetooth: Move memset closer to where it's needed



Minor fix to not do the memset until the variable it clears is
actually used.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 9a01242d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -726,14 +726,14 @@ static void hci_req_add_le_create_conn(struct hci_request *req,
	struct hci_dev *hdev = conn->hdev;
	u8 own_addr_type;

	memset(&cp, 0, sizeof(cp));

	/* Update random address, but set require_privacy to false so
	 * that we never connect with an non-resolvable address.
	 */
	if (hci_update_random_address(req, false, &own_addr_type))
		return;

	memset(&cp, 0, sizeof(cp));

	/* Set window to be the same value as the interval to enable
	 * continuous scanning.
	 */