Skip to content

Commit

Permalink
Bluetooth: Move memset closer to where it's needed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hedberg authored and Marcel Holtmann committed Mar 10, 2016
1 parent 9a01242 commit eec7a01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit eec7a01

Please sign in to comment.