diff options
-rw-r--r-- | net/bluetooth/l2cap.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 3e3cd9d4e52c..9d1f1544d9d3 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2705,8 +2705,9 @@ done: | |||
2705 | case L2CAP_MODE_ERTM: | 2705 | case L2CAP_MODE_ERTM: |
2706 | pi->remote_tx_win = rfc.txwin_size; | 2706 | pi->remote_tx_win = rfc.txwin_size; |
2707 | pi->remote_max_tx = rfc.max_transmit; | 2707 | pi->remote_max_tx = rfc.max_transmit; |
2708 | if (rfc.max_pdu_size > pi->conn->mtu - 10) | 2708 | |
2709 | rfc.max_pdu_size = le16_to_cpu(pi->conn->mtu - 10); | 2709 | if (le16_to_cpu(rfc.max_pdu_size) > pi->conn->mtu - 10) |
2710 | rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10); | ||
2710 | 2711 | ||
2711 | pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); | 2712 | pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); |
2712 | 2713 | ||
@@ -2723,8 +2724,8 @@ done: | |||
2723 | break; | 2724 | break; |
2724 | 2725 | ||
2725 | case L2CAP_MODE_STREAMING: | 2726 | case L2CAP_MODE_STREAMING: |
2726 | if (rfc.max_pdu_size > pi->conn->mtu - 10) | 2727 | if (le16_to_cpu(rfc.max_pdu_size) > pi->conn->mtu - 10) |
2727 | rfc.max_pdu_size = le16_to_cpu(pi->conn->mtu - 10); | 2728 | rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10); |
2728 | 2729 | ||
2729 | pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); | 2730 | pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); |
2730 | 2731 | ||