Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[sfrench/cifs-2.6.git] / net / bridge / br_stp_bpdu.c
index 5854e8285a9c26d8c04a339b64aa3c70433a092c..35cf27087b561d6e9955fd75b4b03213a6e9e8d8 100644 (file)
@@ -137,12 +137,13 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
                struct net_device *dev)
 {
        const unsigned char *dest = eth_hdr(skb)->h_dest;
-       struct net_bridge_port *p = rcu_dereference(dev->br_port);
+       struct net_bridge_port *p;
        struct net_bridge *br;
        const unsigned char *buf;
 
-       if (!p)
+       if (!br_port_exists(dev))
                goto err;
+       p = br_port_get_rcu(dev);
 
        if (!pskb_may_pull(skb, 4))
                goto err;