netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [VLAN] vlan_dev: Initialize dev pointer only when it is being used
@ 2008-01-31  6:55 Benjamin Li
  2008-01-31 14:06 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Li @ 2008-01-31  6:55 UTC (permalink / raw)
  To: kaber, netdev; +Cc: Benjamin Li

Signed-off-by: Benjamin Li <ben@wenli.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-31 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-31  6:55 [PATCH] [VLAN] vlan_dev: Initialize dev pointer only when it is being used Benjamin Li
2008-01-31 14:06 ` Patrick McHardy

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).