OSDN Git Service

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[android-x86/kernel.git] / net / bridge / br_stp_bpdu.c
index e3d7aef..289646e 100644 (file)
@@ -143,10 +143,6 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
        struct net_bridge *br;
        const unsigned char *buf;
 
-       if (!br_port_exists(dev))
-               goto err;
-       p = br_port_get_rcu(dev);
-
        if (!pskb_may_pull(skb, 4))
                goto err;
 
@@ -155,6 +151,10 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
        if (buf[0] != 0 || buf[1] != 0 || buf[2] != 0)
                goto err;
 
+       p = br_port_get_rcu(dev);
+       if (!p)
+               goto err;
+
        br = p->br;
        spin_lock(&br->lock);