diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-03-12 11:13:07 +0100 |
---|---|---|
committer | Gustavo Padovan <gustavo@padovan.org> | 2012-05-09 05:41:31 +0200 |
commit | 61386cba0fae4744b8e2f52c4911fe3af9ff6c54 (patch) | |
tree | ab6bb810b7ef79016734c54efd73aa33f91391d3 /net | |
parent | Bluetooth: Correct ediv in SMP (diff) | |
download | linux-61386cba0fae4744b8e2f52c4911fe3af9ff6c54.tar.xz linux-61386cba0fae4744b8e2f52c4911fe3af9ff6c54.zip |
Bluetooth: Correct length calc in L2CAP conf rsp
cmd->len is in le format so convert it to host format before use.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 7b8a88fd3b78..0914cca7b578 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -2957,14 +2957,14 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr struct l2cap_conf_rsp *rsp = (struct l2cap_conf_rsp *)data; u16 scid, flags, result; struct l2cap_chan *chan; - int len = cmd->len - sizeof(*rsp); + int len = le16_to_cpu(cmd->len) - sizeof(*rsp); scid = __le16_to_cpu(rsp->scid); flags = __le16_to_cpu(rsp->flags); result = __le16_to_cpu(rsp->result); - BT_DBG("scid 0x%4.4x flags 0x%2.2x result 0x%2.2x", - scid, flags, result); + BT_DBG("scid 0x%4.4x flags 0x%2.2x result 0x%2.2x len %d", scid, flags, + result, len); chan = l2cap_get_chan_by_scid(conn, scid); if (!chan) |