From: linmiaohe <linmiaohe@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <pshelar@ovn.org>,
<martin.varghese@nokia.com>, <fw@strlen.de>, <pabeni@redhat.com>,
<edumazet@google.com>, <dcaratti@redhat.com>,
<steffen.klassert@secunet.com>, <shmulik@metanetworks.com>,
<kyk.segfault@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linmiaohe@huawei.com>
Subject: [PATCH] net: Pass NULL to skb_network_protocol() when we don't care about vlan depth
Date: Sat, 1 Aug 2020 17:36:05 +0800 [thread overview]
Message-ID: <1596274565-24655-1-git-send-email-linmiaohe@huawei.com> (raw)
From: Miaohe Lin <linmiaohe@huawei.com>
When we don't care about vlan depth, we could pass NULL instead of the
address of a unused local variable to skb_network_protocol() as a param.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
net/core/skbuff.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3219c26ddfae..8a0c39e4ab0a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3758,7 +3758,6 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
int err = -ENOMEM;
int i = 0;
int pos;
- int dummy;
if (list_skb && !list_skb->head_frag && skb_headlen(list_skb) &&
(skb_shinfo(head_skb)->gso_type & SKB_GSO_DODGY)) {
@@ -3780,7 +3779,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,
}
__skb_push(head_skb, doffset);
- proto = skb_network_protocol(head_skb, &dummy);
+ proto = skb_network_protocol(head_skb, NULL);
if (unlikely(!proto))
return ERR_PTR(-EINVAL);
--
2.19.1
next reply other threads:[~2020-08-01 9:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-01 9:36 linmiaohe [this message]
2020-08-03 22:39 ` [PATCH] net: Pass NULL to skb_network_protocol() when we don't care about vlan depth David Miller
-- strict thread matches above, loose matches on Subject: below --
2020-07-30 11:02 linmiaohe
2020-07-31 23:42 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1596274565-24655-1-git-send-email-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=kuba@kernel.org \
--cc=kyk.segfault@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.varghese@nokia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pshelar@ovn.org \
--cc=shmulik@metanetworks.com \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).