@@ -1995,9 +1995,6 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb)
1995
1995
struct nlattr * nest , * sched_nest ;
1996
1996
unsigned int i ;
1997
1997
1998
- oper = rtnl_dereference (q -> oper_sched );
1999
- admin = rtnl_dereference (q -> admin_sched );
2000
-
2001
1998
opt .num_tc = netdev_get_num_tc (dev );
2002
1999
memcpy (opt .prio_tc_map , dev -> prio_tc_map , sizeof (opt .prio_tc_map ));
2003
2000
@@ -2024,30 +2021,39 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb)
2024
2021
nla_put_u32 (skb , TCA_TAPRIO_ATTR_TXTIME_DELAY , q -> txtime_delay ))
2025
2022
goto options_error ;
2026
2023
2024
+ rcu_read_lock ();
2025
+
2026
+ oper = rtnl_dereference (q -> oper_sched );
2027
+ admin = rtnl_dereference (q -> admin_sched );
2028
+
2027
2029
if (taprio_dump_tc_entries (q , skb ))
2028
- goto options_error ;
2030
+ goto options_error_rcu ;
2029
2031
2030
2032
if (oper && dump_schedule (skb , oper ))
2031
- goto options_error ;
2033
+ goto options_error_rcu ;
2032
2034
2033
2035
if (!admin )
2034
2036
goto done ;
2035
2037
2036
2038
sched_nest = nla_nest_start_noflag (skb , TCA_TAPRIO_ATTR_ADMIN_SCHED );
2037
2039
if (!sched_nest )
2038
- goto options_error ;
2040
+ goto options_error_rcu ;
2039
2041
2040
2042
if (dump_schedule (skb , admin ))
2041
2043
goto admin_error ;
2042
2044
2043
2045
nla_nest_end (skb , sched_nest );
2044
2046
2045
2047
done :
2048
+ rcu_read_unlock ();
2046
2049
return nla_nest_end (skb , nest );
2047
2050
2048
2051
admin_error :
2049
2052
nla_nest_cancel (skb , sched_nest );
2050
2053
2054
+ options_error_rcu :
2055
+ rcu_read_unlock ();
2056
+
2051
2057
options_error :
2052
2058
nla_nest_cancel (skb , nest );
2053
2059
0 commit comments