]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: rtnetlink: remove local list in __linkwatch_run_queue()
authorJohannes Berg <johannes.berg@intel.com>
Tue, 5 Dec 2023 16:00:11 +0000 (17:00 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Dec 2023 03:25:43 +0000 (19:25 -0800)
commitb8dbbbc535a95acd66035cf75872cd7524c0b12f
treee743e5a1afc2cbaff05c51992902b1c8ef84463f
parent5a08d0065a915ccf325563d7ca57fa8b4897881c
net: rtnetlink: remove local list in __linkwatch_run_queue()

Due to linkwatch_forget_dev() (and perhaps others?) checking for
list_empty(&dev->link_watch_list), we must have all manipulations
of even the local on-stack list 'wrk' here under spinlock, since
even that list can be reached otherwise via dev->link_watch_list.

This is already the case, but makes this a bit counter-intuitive,
often local lists are used to _not_ have to use locking for their
local use.

Remove the local list as it doesn't seem to serve any purpose.
While at it, move a variable declaration into the loop using it.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20231205170011.56576dcc1727.I698b72219d9f6ce789bd209b8f6dffd0ca32a8f2@changeid
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/link_watch.c