aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/caif_socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/caif/caif_socket.c')
-rw-r--r--net/caif/caif_socket.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 4ec0c803aef1..112ad784838a 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -330,6 +330,10 @@ static long caif_stream_data_wait(struct sock *sk, long timeo)
330 release_sock(sk); 330 release_sock(sk);
331 timeo = schedule_timeout(timeo); 331 timeo = schedule_timeout(timeo);
332 lock_sock(sk); 332 lock_sock(sk);
333
334 if (sock_flag(sk, SOCK_DEAD))
335 break;
336
333 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); 337 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
334 } 338 }
335 339
@@ -373,6 +377,10 @@ static int caif_stream_recvmsg(struct socket *sock, struct msghdr *msg,
373 struct sk_buff *skb; 377 struct sk_buff *skb;
374 378
375 lock_sock(sk); 379 lock_sock(sk);
380 if (sock_flag(sk, SOCK_DEAD)) {
381 err = -ECONNRESET;
382 goto unlock;
383 }
376 skb = skb_dequeue(&sk->sk_receive_queue); 384 skb = skb_dequeue(&sk->sk_receive_queue);
377 caif_check_flow_release(sk); 385 caif_check_flow_release(sk);
378 386