|
@@ -2852,6 +2852,9 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code,
|
|
|
BT_DBG("conn %p, code 0x%2.2x, ident 0x%2.2x, len %u",
|
|
|
conn, code, ident, dlen);
|
|
|
|
|
|
+ if (conn->mtu < L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
len = L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE + dlen;
|
|
|
count = min_t(unsigned int, conn->mtu, len);
|
|
|
|