aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index 92a56709fd7..954f3381cc8 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1100,11 +1100,14 @@ static int sock_fasync(int fd, struct file *filp, int on)
1100 fna->fa_next = sock->fasync_list; 1100 fna->fa_next = sock->fasync_list;
1101 write_lock_bh(&sk->sk_callback_lock); 1101 write_lock_bh(&sk->sk_callback_lock);
1102 sock->fasync_list = fna; 1102 sock->fasync_list = fna;
1103 sock_set_flag(sk, SOCK_FASYNC);
1103 write_unlock_bh(&sk->sk_callback_lock); 1104 write_unlock_bh(&sk->sk_callback_lock);
1104 } else { 1105 } else {
1105 if (fa != NULL) { 1106 if (fa != NULL) {
1106 write_lock_bh(&sk->sk_callback_lock); 1107 write_lock_bh(&sk->sk_callback_lock);
1107 *prev = fa->fa_next; 1108 *prev = fa->fa_next;
1109 if (!sock->fasync_list)
1110 sock_reset_flag(sk, SOCK_FASYNC);
1108 write_unlock_bh(&sk->sk_callback_lock); 1111 write_unlock_bh(&sk->sk_callback_lock);
1109 kfree(fa); 1112 kfree(fa);
1110 } 1113 }