net: Pass NULL to skb_network_protocol() when we don't care about vlan depth
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 30 Jul 2020 11:02:36 +0000 (19:02 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Jul 2020 23:42:30 +0000 (16:42 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index fe2e387eed29c64207a237612abb905753b3fd77..38a6371d9bc5f591d8e9a35e870f3b445c5bc3d3 100644 (file)
@@ -3454,10 +3454,9 @@ static netdev_features_t net_mpls_features(struct sk_buff *skb,
 static netdev_features_t harmonize_features(struct sk_buff *skb,
        netdev_features_t features)
 {
-       int tmp;
        __be16 type;
 
-       type = skb_network_protocol(skb, &tmp);
+       type = skb_network_protocol(skb, NULL);
        features = net_mpls_features(skb, features, type);
 
        if (skb->ip_summed != CHECKSUM_NONE &&