diff options
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index f1a51564b8fd..7913c28c643d 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -307,7 +307,7 @@ static int l2cap_sock_accept(struct socket *sock, struct socket *newsock, | |||
307 | long timeo; | 307 | long timeo; |
308 | int err = 0; | 308 | int err = 0; |
309 | 309 | ||
310 | lock_sock_nested(sk, SINGLE_DEPTH_NESTING); | 310 | lock_sock_nested(sk, L2CAP_NESTING_PARENT); |
311 | 311 | ||
312 | timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK); | 312 | timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK); |
313 | 313 | ||
@@ -339,7 +339,7 @@ static int l2cap_sock_accept(struct socket *sock, struct socket *newsock, | |||
339 | 339 | ||
340 | release_sock(sk); | 340 | release_sock(sk); |
341 | timeo = schedule_timeout(timeo); | 341 | timeo = schedule_timeout(timeo); |
342 | lock_sock_nested(sk, SINGLE_DEPTH_NESTING); | 342 | lock_sock_nested(sk, L2CAP_NESTING_PARENT); |
343 | } | 343 | } |
344 | __set_current_state(TASK_RUNNING); | 344 | __set_current_state(TASK_RUNNING); |
345 | remove_wait_queue(sk_sleep(sk), &wait); | 345 | remove_wait_queue(sk_sleep(sk), &wait); |
@@ -1252,7 +1252,14 @@ static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err) | |||
1252 | struct sock *sk = chan->data; | 1252 | struct sock *sk = chan->data; |
1253 | struct sock *parent; | 1253 | struct sock *parent; |
1254 | 1254 | ||
1255 | lock_sock_nested(sk, SINGLE_DEPTH_NESTING); | 1255 | /* This callback can be called both for server (BT_LISTEN) |
1256 | * sockets as well as "normal" ones. To avoid lockdep warnings | ||
1257 | * with child socket locking (through l2cap_sock_cleanup_listen) | ||
1258 | * we need separation into separate nesting levels. The simplest | ||
1259 | * way to accomplish this is to inherit the nesting level used | ||
1260 | * for the channel. | ||
1261 | */ | ||
1262 | lock_sock_nested(sk, atomic_read(&chan->nesting)); | ||
1256 | 1263 | ||
1257 | parent = bt_sk(sk)->parent; | 1264 | parent = bt_sk(sk)->parent; |
1258 | 1265 | ||