Commit bbb69b37 authored by Fugang Duan's avatar Fugang Duan Committed by 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: default avatarFugang Duan <fugang.duan@nxp.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment