[PATCH net-next v2] net/core: fix wrong return value in __splice_segment
From: Pengtao He
Date: Thu Jul 24 2025 - 06:30:01 EST
Return true immediately when the last segment is processed,
avoid to walking once more in the frags loop.
Signed-off-by: Pengtao He <hept.hept.hept@xxxxxxxxx>
---
v2->v1:
Correct the commit message and target tree.
v1:
https://lore.kernel.org/netdev/20250723063119.24059-1-hept.hept.hept@xxxxxxxxx/
---
net/core/skbuff.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ee0274417948..cc3339ab829a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3114,6 +3114,9 @@ static bool __splice_segment(struct page *page, unsigned int poff,
*len -= flen;
} while (*len && plen);
+ if (!*len)
+ return true;
+
return false;
}
--
2.49.0