1

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>
This commit is contained in:
Zhang Changzhong 2024-08-15 22:09:42 +08:00 committed by Jakub Kicinski
parent af3dc0ad31
commit dca9d62a0d

View File

@ -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 /* Actual merge is delayed until the point when we know we can
* commit all, so that we don't have to undo partial changes * commit all, so that we don't have to undo partial changes
*/ */
if (!to || if (!skb_can_coalesce(tgt, to, skb_frag_page(fragfrom),
!skb_can_coalesce(tgt, to, skb_frag_page(fragfrom),
skb_frag_off(fragfrom))) { skb_frag_off(fragfrom))) {
merge = -1; merge = -1;
} else { } else {