aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-18 06:43:00 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-18 07:37:01 -0400
commit06ae3314e0f67a222944155904a792399038f8be (patch)
tree786c2fc6d7145b785c30c439a2cc44a13b452d77 /net/bluetooth
parente71f41bc7f73ec7f2cb678b51ace47eb05dc6af1 (diff)
Bluetooth: Use hcon directly instead of conn->hcon where possible
When the HCI connection hcon is already dereferenced, then use hcon directly instead of conn->hcon. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_core.c7
-rw-r--r--net/bluetooth/smp.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 763b7417dab7..97572970fba2 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6399,8 +6399,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm,
6399 if (hcon->type != ACL_LINK) 6399 if (hcon->type != ACL_LINK)
6400 goto drop; 6400 goto drop;
6401 6401
6402 chan = l2cap_global_chan_by_psm(0, psm, &conn->hcon->src, 6402 chan = l2cap_global_chan_by_psm(0, psm, &hcon->src, &hcon->dst);
6403 &conn->hcon->dst);
6404 if (!chan) 6403 if (!chan)
6405 goto drop; 6404 goto drop;
6406 6405
@@ -6413,7 +6412,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm,
6413 goto drop; 6412 goto drop;
6414 6413
6415 /* Store remote BD_ADDR and PSM for msg_name */ 6414 /* Store remote BD_ADDR and PSM for msg_name */
6416 bacpy(&bt_cb(skb)->bdaddr, &conn->hcon->dst); 6415 bacpy(&bt_cb(skb)->bdaddr, &hcon->dst);
6417 bt_cb(skb)->psm = psm; 6416 bt_cb(skb)->psm = psm;
6418 6417
6419 if (!chan->ops->recv(chan, skb)) 6418 if (!chan->ops->recv(chan, skb))
@@ -6433,7 +6432,7 @@ static void l2cap_att_channel(struct l2cap_conn *conn,
6433 goto drop; 6432 goto drop;
6434 6433
6435 chan = l2cap_global_chan_by_scid(BT_CONNECTED, L2CAP_CID_ATT, 6434 chan = l2cap_global_chan_by_scid(BT_CONNECTED, L2CAP_CID_ATT,
6436 &conn->hcon->src, &conn->hcon->dst); 6435 &hcon->src, &hcon->dst);
6437 if (!chan) 6436 if (!chan)
6438 goto drop; 6437 goto drop;
6439 6438
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index fc200e06aa04..85a2796cac61 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -864,7 +864,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
864 return -EILSEQ; 864 return -EILSEQ;
865 } 865 }
866 866
867 if (!test_bit(HCI_LE_ENABLED, &conn->hcon->hdev->dev_flags)) { 867 if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) {
868 err = -ENOTSUPP; 868 err = -ENOTSUPP;
869 reason = SMP_PAIRING_NOTSUPP; 869 reason = SMP_PAIRING_NOTSUPP;
870 goto done; 870 goto done;