From: stephen hemminger Date: Thu, 2 May 2013 14:23:28 +0000 (+0000) Subject: bridge: fix race with topology change timer X-Git-Tag: v3.10-rc1~94^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83401eb4990ff6af55aeed8f49681558544192e6;p=profile%2Fcommon%2Fkernel-common.git bridge: fix race with topology change timer A bridge should only send topology change notice if it is not the root bridge. It is possible for message age timer to elect itself as a new root bridge, and still have a topology change timer running but waiting for bridge lock on other CPU. Solve the race by checking if we are root bridge before continuing. This was the root cause of the cases where br_send_tcn_bpdu would OOPS. Reported-by: JerryKang Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c index c3530a8..950663d 100644 --- a/net/bridge/br_stp_timer.c +++ b/net/bridge/br_stp_timer.c @@ -107,7 +107,7 @@ static void br_tcn_timer_expired(unsigned long arg) br_debug(br, "tcn timer expired\n"); spin_lock(&br->lock); - if (br->dev->flags & IFF_UP) { + if (!br_is_root_bridge(br) && (br->dev->flags & IFF_UP)) { br_transmit_tcn(br); mod_timer(&br->tcn_timer,jiffies + br->bridge_hello_time);