From: Herbert Xu Date: Tue, 6 Sep 2005 01:55:48 +0000 (-0700) Subject: [TCP]: Fix TCP_OFF() bug check introduced by previous change. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fb5f5e6e0cebd574be737334671d1aa8f170d5f3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index cbcc9fc47783..f3f0013a9580 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -769,10 +769,10 @@ new_segment: 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;