[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200827112342.44526-1-linmiaohe@huawei.com>
Date: Thu, 27 Aug 2020 07:23:42 -0400
From: Miaohe Lin <linmiaohe@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <pshelar@....org>,
<fw@...len.de>, <martin.varghese@...ia.com>, <edumazet@...gle.com>,
<dcaratti@...hat.com>, <steffen.klassert@...unet.com>,
<pabeni@...hat.com>, <shmulik@...anetworks.com>,
<kyk.segfault@...il.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH] net: exit immediately when off = 0 in skb_headers_offset_update()
In the case of off = 0, skb_headers_offset_update() do nothing indeed.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
net/core/skbuff.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 18ed56316e56..f67f0da20a5b 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1459,6 +1459,8 @@ EXPORT_SYMBOL(skb_clone);
void skb_headers_offset_update(struct sk_buff *skb, int off)
{
+ if (unlikely(off == 0))
+ return;
/* Only adjust this if it actually is csum_start rather than csum */
if (skb->ip_summed == CHECKSUM_PARTIAL)
skb->csum_start += off;
--
2.19.1
Powered by blists - more mailing lists