aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-12-06 00:08:53 -0500
committerMarcel Holtmann <marcel@holtmann.org>2013-12-06 01:07:42 -0500
commitc8afe8d0ad796b6dae545ceeed652b2c52ca7cf6 (patch)
tree818815a71b8592aa5a4d9e863a6508130899b907
parentf1324ea50b2e48d30fbeac591771fdceac9315ca (diff)
Bluetooth: Fix valid LE PSM check
The range of valid LE PSMs is 0x0001-0x00ff so the check should be for "less than or equal to" instead of "less than". Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/l2cap_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 35feb9d6c322..ae0054ccee5b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1851,7 +1851,7 @@ static bool is_valid_psm(u16 psm, u8 dst_type)
1851 return false; 1851 return false;
1852 1852
1853 if (bdaddr_type_is_le(dst_type)) 1853 if (bdaddr_type_is_le(dst_type))
1854 return (psm < 0x00ff); 1854 return (psm <= 0x00ff);
1855 1855
1856 /* PSM must be odd and lsb of upper byte must be 0 */ 1856 /* PSM must be odd and lsb of upper byte must be 0 */
1857 return ((psm & 0x0101) == 0x0001); 1857 return ((psm & 0x0101) == 0x0001);