[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1201762524-28403-1-git-send-email-ben@wenli.org>
Date: Wed, 30 Jan 2008 22:55:24 -0800
From: Benjamin Li <ben@...li.org>
To: kaber@...sh.net, netdev@...r.kernel.org
Cc: Benjamin Li <ben@...li.org>
Subject: [PATCH] [VLAN] vlan_dev: Initialize dev pointer only when it is being used
Signed-off-by: Benjamin Li <ben@...li.org>
---
net/8021q/vlan_dev.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 8059fa4..2fa5d68 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -49,7 +49,7 @@
*/
static int vlan_dev_rebuild_header(struct sk_buff *skb)
{
- struct net_device *dev = skb->dev;
+ struct net_device *dev;
struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
switch (veth->h_vlan_encapsulated_proto) {
@@ -60,6 +60,7 @@ static int vlan_dev_rebuild_header(struct sk_buff *skb)
return arp_find(veth->h_dest, skb);
#endif
default:
+ dev = skb->dev;
pr_debug("%s: unable to resolve type %X addresses.\n",
dev->name, ntohs(veth->h_vlan_encapsulated_proto));
--
1.5.3.8
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists