Commit fb5f5e6e authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[TCP]: Fix TCP_OFF() bug check introduced by previous change.

The TCP_OFF assignment at the bottom of that if block can indeed set
TCP_OFF without setting TCP_PAGE.  Since there is not much to be
gained from avoiding this situation, we might as well just zap the
offset.  The following patch should fix it.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1198ad00
...@@ -769,10 +769,10 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -769,10 +769,10 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (off == PAGE_SIZE) { if (off == PAGE_SIZE) {
put_page(page); put_page(page);
TCP_PAGE(sk) = page = NULL; TCP_PAGE(sk) = page = NULL;
TCP_OFF(sk) = off = 0; off = 0;
} }
} else } else
BUG_ON(off); off = 0;
if (copy > PAGE_SIZE - off) if (copy > PAGE_SIZE - off)
copy = PAGE_SIZE - off; copy = PAGE_SIZE - off;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment