From: Johan Hedberg Date: Fri, 6 Dec 2013 05:08:53 +0000 (+0200) Subject: Bluetooth: Fix valid LE PSM check X-Git-Tag: v5.15~18574^2~482^2^2~9^2~3 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=c8afe8d0ad796b6dae545ceeed652b2c52ca7cf6;p=mirror_ubuntu-kernels.git 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 Signed-off-by: Marcel Holtmann --- 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) return false; if (bdaddr_type_is_le(dst_type)) - return (psm < 0x00ff); + return (psm <= 0x00ff); /* PSM must be odd and lsb of upper byte must be 0 */ return ((psm & 0x0101) == 0x0001);