net: bluetooth: clean up harmless false expression
Subsystems (4)
PATCH 1/1 net: bluetooth: clean up harmless false expression
From: Jean Sacren <[email protected]>
scid is u16 with a range from 0x0000 to 0xffff. L2CAP_CID_DYN_END is 0xffff. We should drop the false check of (scid > L2CAP_CID_DYN_END).
Signed-off-by Jean Sacren <[email protected]>
--- net/bluetooth/l2cap_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +1 -1
@@ -4118,7 +4118,7 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, result =L2CAP_CR_NO_MEM ;/* Check for valid dynamic CID range (as per Erratum 3253) */ -if (scid <L2CAP_CID_DYN_START || scid >L2CAP_CID_DYN_END ) { +if (scid <L2CAP_CID_DYN_START ) { result =L2CAP_CR_INVALID_SCID ; goto response; }
Marcel Holtmann
maintainerHi Jean,
Quoted 13 lines
scid is u16 with a range from
0x0000to0xffff.L2CAP_CID_DYN_ENDis0xffff. We should drop the false check of (scid >L2CAP_CID_DYN_END).Signed-off-by Jean Sacren <[email protected]>---
net/bluetooth/l2cap_core.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)net/bluetooth/l2cap_core.c +0
-0
net/bluetooth/l2cap_core.c static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, · line 4124
Quoted 8 lines
net/bluetooth/l2cap_core.c +1
-1@@ -4118,7 +4118,7 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, result =L2CAP_CR_NO_MEM ;/* Check for valid dynamic CID range (as per Erratum 3253) */ -if (scid <L2CAP_CID_DYN_START || scid >L2CAP_CID_DYN_END ) { +if (scid <L2CAP_CID_DYN_START ) { result =L2CAP_CR_INVALID_SCID ; goto response; }
so I realize that this might be a pointless check, but I rather keep it. It really doesn’t do any harm.
Regards
Marcel