From: Ian Wilson Date: Thu, 24 Sep 2015 18:20:11 +0000 (-0700) Subject: bridge: Allow forward delay to be cfgd when STP enabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=34c2d9fb0498c066afbe610b15e18995fd8be792;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git bridge: Allow forward delay to be cfgd when STP enabled Allow bridge forward delay to be configured when Spanning Tree is enabled. Signed-off-by: Ian Wilson Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index ed74ffaa851f..3a7392e6010e 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c @@ -576,17 +576,12 @@ void __br_set_forward_delay(struct net_bridge *br, unsigned long t) int br_set_forward_delay(struct net_bridge *br, unsigned long val) { unsigned long t = clock_t_to_jiffies(val); - int err = -ERANGE; - spin_lock_bh(&br->lock); - if (br->stp_enabled != BR_NO_STP && - (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY)) - goto unlock; + if (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY) + return -ERANGE; + spin_lock_bh(&br->lock); __br_set_forward_delay(br, t); - err = 0; - -unlock: spin_unlock_bh(&br->lock); - return err; + return 0; }