]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: taprio: taprio_offload_config_changed() is protected by rtnl_mutex
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 15 Sep 2022 10:50:40 +0000 (13:50 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 20 Sep 2022 20:53:33 +0000 (13:53 -0700)
commit85d17599660f9c86fd4ad7285eccbb3efc939d95
tree0dc5dc0a86308b29341f43db70eaa4cfd33f64cf
parent923f5948b584053f175f8a902819e60d99ed453f
net/sched: taprio: taprio_offload_config_changed() is protected by rtnl_mutex

The locking in taprio_offload_config_changed() is wrong (but also
inconsequentially so). The current_entry_lock does not serialize changes
to the admin and oper schedules, only to the current entry. In fact, the
rtnl_mutex does that, and that is taken at the time when taprio_change()
is called.

Replace the rcu_dereference_protected() method with the proper RCU
annotation, and drop the unnecessary spin lock.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_taprio.c