diff options
author | Dave Airlie <airlied@redhat.com> | 2017-11-02 12:40:41 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-11-02 12:40:41 +1000 |
commit | 7a88cbd8d65d622c00bd76ba4ae1d893b292c91c (patch) | |
tree | 826df7ac42ca13c33828d0142046186b91df686b /net/core/skbuff.c | |
parent | 0a4334c9e5405f836c46375c6e279cfdda7da6b5 (diff) | |
parent | 0b07194bb55ed836c2cc7c22e866b87a14681984 (diff) | |
download | linux-7a88cbd8d65d622c00bd76ba4ae1d893b292c91c.tar.bz2 |
Backmerge tag 'v4.14-rc7' into drm-next
Linux 4.14-rc7
Requested by Ben Skeggs for nouveau to avoid major conflicts,
and things were getting a bit conflicty already, esp around amdgpu
reverts.
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 16982de649b9..24656076906d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1124,9 +1124,13 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb, err = __zerocopy_sg_from_iter(sk, skb, &msg->msg_iter, len); if (err == -EFAULT || (err == -EMSGSIZE && skb->len == orig_len)) { + struct sock *save_sk = skb->sk; + /* Streams do not free skb on error. Reset to prev state. */ msg->msg_iter = orig_iter; + skb->sk = sk; ___pskb_trim(skb, orig_len); + skb->sk = save_sk; return err; } @@ -1896,7 +1900,7 @@ void *__pskb_pull_tail(struct sk_buff *skb, int delta) } /* If we need update frag list, we are in troubles. - * Certainly, it possible to add an offset to skb data, + * Certainly, it is possible to add an offset to skb data, * but taking into account that pulling is expected to * be very rare operation, it is worth to fight against * further bloating skb head and crucify ourselves here instead. |