Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a4a060b authored by Willem de Bruijn's avatar Willem de Bruijn Committed by David S. Miller
Browse files

sock: fix zerocopy_success regression with msg_zerocopy



Do not use uarg->zerocopy outside msg_zerocopy. In other paths the
field is not explicitly initialized and aliases another field.

Those paths have only one reference so do not need this intermediate
variable. Call uarg->callback directly.

Fixes: 1f8b977a ("sock: enable MSG_ZEROCOPY")
Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ccaffff1
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1273,8 +1273,13 @@ static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy)
	struct ubuf_info *uarg = skb_zcopy(skb);

	if (uarg) {
		if (uarg->callback == sock_zerocopy_callback) {
			uarg->zerocopy = uarg->zerocopy && zerocopy;
			sock_zerocopy_put(uarg);
		} else {
			uarg->callback(uarg, zerocopy);
		}

		skb_shinfo(skb)->tx_flags &= ~SKBTX_ZEROCOPY_FRAG;
	}
}