From ce3dd39595d9d64f4ba6ee8dd24c6269a3b56b6a Mon Sep 17 00:00:00 2001 From: Jarek Poplawski Date: Thu, 12 Feb 2009 16:51:43 -0800 Subject: net: Fix page seeking for skb_splice_bits(). struct page walking should be done with proper accessor functions, not directly. With doubts from David S. Miller and Herbert Xu. Signed-off-by: Jarek Poplawski Signed-off-by: David S. Miller --- net/core/skbuff.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'net/core/skbuff.c') diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7657cec5973..ab7d2e9f02f 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1412,8 +1412,13 @@ static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page, static inline void __segment_seek(struct page **page, unsigned int *poff, unsigned int *plen, unsigned int off) { + unsigned long n; + *poff += off; - *page += *poff / PAGE_SIZE; + n = *poff / PAGE_SIZE; + if (n) + *page = nth_page(*page, n); + *poff = *poff % PAGE_SIZE; *plen -= off; } -- cgit v1.2.3-70-g09d2