bridge: fix gc_timer mod/del race condition
[sfrench/cifs-2.6.git] / net / bridge / br_sysfs_br.c
index 04ef1926ee7eea204756c258e9b0689316ef5f15..8365bd53c42179dec15314fa99bf2346f729899f 100644 (file)
@@ -102,7 +102,15 @@ static ssize_t ageing_time_show(struct device *d,
 
 static int set_ageing_time(struct net_bridge *br, unsigned long val)
 {
-       return br_set_ageing_time(br, val);
+       int ret;
+
+       if (!rtnl_trylock())
+               return restart_syscall();
+
+       ret = br_set_ageing_time(br, val);
+       rtnl_unlock();
+
+       return ret;
 }
 
 static ssize_t ageing_time_store(struct device *d,