tcp-repair: Handle zero-length data put in rcv queue
[platform/upstream/kernel-adaptation-pc.git] / net / ipv4 / tcp_input.c
index 1db6639..2c2b13a 100644 (file)
@@ -4529,6 +4529,9 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
        struct tcphdr *th;
        bool fragstolen;
 
+       if (size == 0)
+               return 0;
+
        skb = alloc_skb(size + sizeof(*th), sk->sk_allocation);
        if (!skb)
                goto err;