Skip to content

Commit

Permalink
[TCP]: Fix TCP_OFF() bug check introduced by previous change.
Browse files Browse the repository at this point in the history
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: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Sep 6, 2005
1 parent 1198ad0 commit fb5f5e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,10 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (off == PAGE_SIZE) {
put_page(page);
TCP_PAGE(sk) = page = NULL;
TCP_OFF(sk) = off = 0;
off = 0;
}
} else
BUG_ON(off);
off = 0;

if (copy > PAGE_SIZE - off)
copy = PAGE_SIZE - off;
Expand Down

0 comments on commit fb5f5e6

Please sign in to comment.