Skip to content

Commit f153831

Browse files
Hugh Dickinskuba-moo
authored andcommitted
net: fix rc7's __skb_datagram_iter()
X would not start in my old 32-bit partition (and the "n"-handling looks just as wrong on 64-bit, but for whatever reason did not show up there): "n" must be accumulated over all pages before it's added to "offset" and compared with "copy", immediately after the skb_frag_foreach_page() loop. Fixes: d2d30a3 ("net: allow skb_datagram_iter to be called from any context") Signed-off-by: Hugh Dickins <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 528269f commit f153831

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/core/datagram.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,12 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
423423
if (copy > len)
424424
copy = len;
425425

426+
n = 0;
426427
skb_frag_foreach_page(frag,
427428
skb_frag_off(frag) + offset - start,
428429
copy, p, p_off, p_len, copied) {
429430
vaddr = kmap_local_page(p);
430-
n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
431+
n += INDIRECT_CALL_1(cb, simple_copy_to_iter,
431432
vaddr + p_off, p_len, data, to);
432433
kunmap_local(vaddr);
433434
}

0 commit comments

Comments
 (0)