summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorZhang Changzhong <zhangchangzhong@huawei.com>2024-08-15 22:09:42 +0800
committerJakub Kicinski <kuba@kernel.org>2024-08-19 18:20:18 -0700
commitdca9d62a0d7684a5510645ba05960529c5066457 (patch)
tree36735c11aece8dc1d3d293bdb5d6b1ca00fed7c4 /net/core
parentaf3dc0ad3167985894a292968c67502f42854e6d (diff)
net: remove redundant check in skb_shift()
The check for '!to' is redundant here, since skb_can_coalesce() already contains this check. Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/1723730983-22912-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index de2a044cc665..1748673e1fe0 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -4172,8 +4172,7 @@ int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
/* Actual merge is delayed until the point when we know we can
* commit all, so that we don't have to undo partial changes
*/
- if (!to ||
- !skb_can_coalesce(tgt, to, skb_frag_page(fragfrom),
+ if (!skb_can_coalesce(tgt, to, skb_frag_page(fragfrom),
skb_frag_off(fragfrom))) {
merge = -1;
} else {