summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2016-03-09 17:30:32 +0200
committerMarcel Holtmann <marcel@holtmann.org>2016-03-10 19:51:29 +0100
commiteec7a01dc8366f7e43fc0417f4aee70eaeaca9a9 (patch)
treed7b18e5e2c815ab5df2cd904a4d56e3dc3cb4ed7
parent9a01242dc7fc4d5fe3f722afbf35b33aa414cd2f (diff)
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: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_conn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 32575b49f4a0..7264025dc781 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -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.
*/