Skip to content

Commit

Permalink
Bluetooth: Remove useless access to the socket
Browse files Browse the repository at this point in the history
We already have access to the chan, we don't have to access the
socket to get its imtu.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
  • Loading branch information
Vinicius Costa Gomes authored and Gustavo F. Padovan committed Jun 20, 2011
1 parent 6312845 commit e13e21d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3965,7 +3965,7 @@ static inline int l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, str
if (chan->state != BT_BOUND && chan->state != BT_CONNECTED)
goto drop;

if (l2cap_pi(sk)->chan->imtu < skb->len)
if (chan->imtu < skb->len)
goto drop;

if (!chan->ops->recv(chan->data, skb))
Expand Down Expand Up @@ -3998,7 +3998,7 @@ static inline int l2cap_att_channel(struct l2cap_conn *conn, __le16 cid, struct
if (chan->state != BT_BOUND && chan->state != BT_CONNECTED)
goto drop;

if (l2cap_pi(sk)->chan->imtu < skb->len)
if (chan->imtu < skb->len)
goto drop;

if (!chan->ops->recv(chan->data, skb))
Expand Down

0 comments on commit e13e21d

Please sign in to comment.