]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - net/ipv4/tcp_input.c
tcp: perform DMA to userspace only if there is a task waiting for it
[linux-imx.git] / net / ipv4 / tcp_input.c
index aa659e825054820c112caf8eafb2e73e7bd01085..a356e1fecf9ad7782db4373b1b03d3f20ba604b3 100644 (file)
@@ -5475,7 +5475,9 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
                        if (tp->copied_seq == tp->rcv_nxt &&
                            len - tcp_header_len <= tp->ucopy.len) {
 #ifdef CONFIG_NET_DMA
-                               if (tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
+                               if (tp->ucopy.task == current &&
+                                   sock_owned_by_user(sk) &&
+                                   tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
                                        copied_early = 1;
                                        eaten = 1;
                                }