]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - net/ipv6/ip6_output.c
net: correct zerocopy refcnt with udp MSG_MORE
[thirdparty/kernel/linux.git] / net / ipv6 / ip6_output.c
index adef2236abe2e767602a9d4afbf23fc6db5750dd..f9e43323e6673463d00880f3652a20bd77fb010d 100644 (file)
@@ -1275,7 +1275,7 @@ static int __ip6_append_data(struct sock *sk,
        int csummode = CHECKSUM_NONE;
        unsigned int maxnonfragsize, headersize;
        unsigned int wmem_alloc_delta = 0;
-       bool paged, extra_uref;
+       bool paged, extra_uref = false;
 
        skb = skb_peek_tail(queue);
        if (!skb) {
@@ -1344,7 +1344,7 @@ emsgsize:
                uarg = sock_zerocopy_realloc(sk, length, skb_zcopy(skb));
                if (!uarg)
                        return -ENOBUFS;
-               extra_uref = true;
+               extra_uref = !skb;      /* only extra ref if !MSG_MORE */
                if (rt->dst.dev->features & NETIF_F_SG &&
                    csummode == CHECKSUM_PARTIAL) {
                        paged = true;