X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=net%2Fbridge%2Fbr_stp_bpdu.c;h=289646ec9b7bdab6d1f167f1524da3ae40d59e67;hb=81c2bdb68855b29a4339313a6f0d07791b663ce7;hp=e3d7aefa91811d8945d9283d5de7ede9b168da34;hpb=1161ec944916069ceec21c487e30247d9ff22857;p=karo-tx-linux.git diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c index e3d7aefa9181..289646ec9b7b 100644 --- a/net/bridge/br_stp_bpdu.c +++ b/net/bridge/br_stp_bpdu.c @@ -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);