From: Marcel Holtmann Date: Wed, 16 Oct 2013 16:31:17 +0000 (-0700) Subject: Bluetooth: Socket address parameter for CID is in little endian X-Git-Tag: accepted/tizen/common/20141203.182822~719^2~3^2^2~307^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f59ddada192583aee81ebf0de4cdc5a94642915;p=platform%2Fkernel%2Flinux-arm64.git Bluetooth: Socket address parameter for CID is in little endian The L2CAP socket parameter for CID are actually provided in little endian. So convert our constants into little endian before comparing them. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 95498d5..34e5a58 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -77,7 +77,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) if (la.l2_psm) return -EINVAL; /* We only allow ATT user space socket */ - if (la.l2_cid != L2CAP_CID_ATT) + if (la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT)) return -EINVAL; } @@ -170,7 +170,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, if (la.l2_psm) return -EINVAL; /* We only allow ATT user space socket */ - if (la.l2_cid != L2CAP_CID_ATT) + if (la.l2_cid != __constant_cpu_to_le16(L2CAP_CID_ATT)) return -EINVAL; }