Commit 06ae3314 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

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: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent e71f41bc
...@@ -6399,8 +6399,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, ...@@ -6399,8 +6399,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm,
if (hcon->type != ACL_LINK) if (hcon->type != ACL_LINK)
goto drop; goto drop;
chan = l2cap_global_chan_by_psm(0, psm, &conn->hcon->src, chan = l2cap_global_chan_by_psm(0, psm, &hcon->src, &hcon->dst);
&conn->hcon->dst);
if (!chan) if (!chan)
goto drop; goto drop;
...@@ -6413,7 +6412,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, ...@@ -6413,7 +6412,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm,
goto drop; goto drop;
/* Store remote BD_ADDR and PSM for msg_name */ /* Store remote BD_ADDR and PSM for msg_name */
bacpy(&bt_cb(skb)->bdaddr, &conn->hcon->dst); bacpy(&bt_cb(skb)->bdaddr, &hcon->dst);
bt_cb(skb)->psm = psm; bt_cb(skb)->psm = psm;
if (!chan->ops->recv(chan, skb)) if (!chan->ops->recv(chan, skb))
...@@ -6433,7 +6432,7 @@ static void l2cap_att_channel(struct l2cap_conn *conn, ...@@ -6433,7 +6432,7 @@ static void l2cap_att_channel(struct l2cap_conn *conn,
goto drop; goto drop;
chan = l2cap_global_chan_by_scid(BT_CONNECTED, L2CAP_CID_ATT, chan = l2cap_global_chan_by_scid(BT_CONNECTED, L2CAP_CID_ATT,
&conn->hcon->src, &conn->hcon->dst); &hcon->src, &hcon->dst);
if (!chan) if (!chan)
goto drop; goto drop;
......
...@@ -864,7 +864,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -864,7 +864,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
return -EILSEQ; return -EILSEQ;
} }
if (!test_bit(HCI_LE_ENABLED, &conn->hcon->hdev->dev_flags)) { if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) {
err = -ENOTSUPP; err = -ENOTSUPP;
reason = SMP_PAIRING_NOTSUPP; reason = SMP_PAIRING_NOTSUPP;
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment