projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android
[firefly-linux-kernel-4.4.55.git]
/
net
/
bluetooth
/
l2cap_sock.c
diff --git
a/net/bluetooth/l2cap_sock.c
b/net/bluetooth/l2cap_sock.c
index 36fed40c162cff5361c9dbdf9cfd5f313e47743a..5f36f70ce44d3f8607735b85c19cfa0655b617e7 100644
(file)
--- a/
net/bluetooth/l2cap_sock.c
+++ b/
net/bluetooth/l2cap_sock.c
@@
-887,7
+887,8
@@
static int l2cap_sock_shutdown(struct socket *sock, int how)
l2cap_chan_close(chan, 0);
lock_sock(sk);
l2cap_chan_close(chan, 0);
lock_sock(sk);
- if (sock_flag(sk, SOCK_LINGER) && sk->sk_lingertime)
+ if (sock_flag(sk, SOCK_LINGER) && sk->sk_lingertime &&
+ !(current->flags & PF_EXITING))
err = bt_sock_wait_state(sk, BT_CLOSED,
sk->sk_lingertime);
}
err = bt_sock_wait_state(sk, BT_CLOSED,
sk->sk_lingertime);
}
@@
-949,13
+950,16
@@
static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
/* Check for backlog size */
if (sk_acceptq_is_full(parent)) {
BT_DBG("backlog full %d", parent->sk_ack_backlog);
/* Check for backlog size */
if (sk_acceptq_is_full(parent)) {
BT_DBG("backlog full %d", parent->sk_ack_backlog);
+ release_sock(parent);
return NULL;
}
sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP,
GFP_ATOMIC);
return NULL;
}
sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP,
GFP_ATOMIC);
- if (!sk)
+ if (!sk) {
+ release_sock(parent);
return NULL;
return NULL;
+ }
bt_sock_reclassify_lock(sk, BTPROTO_L2CAP);
bt_sock_reclassify_lock(sk, BTPROTO_L2CAP);