提交 bbb69b37 编写于 作者: F Fugang Duan 提交者: Marcel Holtmann

Bluetooth: Add return check for L2CAP security level set

Add return check for security level set for socket interface since
stack will check the return value.
Signed-off-by: NFugang Duan <fugang.duan@nxp.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 ba8f5289
......@@ -791,10 +791,13 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
conn = chan->conn;
/*change security for LE channels */
/* change security for LE channels */
if (chan->scid == L2CAP_CID_ATT) {
if (smp_conn_security(conn->hcon, sec.level))
if (smp_conn_security(conn->hcon, sec.level)) {
err = -EINVAL;
break;
}
set_bit(FLAG_PENDING_SECURITY, &chan->flags);
sk->sk_state = BT_CONFIG;
chan->state = BT_CONFIG;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册