]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: shaper: add a comment why we don't need kfree_rcu() in flush
authorJakub Kicinski <kuba@kernel.org>
Tue, 9 Jun 2026 18:32:23 +0000 (11:32 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 11 Jun 2026 10:55:23 +0000 (12:55 +0200)
We keep getting misguided patches to fix the flush.
Add a comment.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20260609183224.1108521-4-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/shaper/shaper.c

index 33958462e5e99c02316b7e7cf6fca6740167e56d..5a3b44c5d10f6375d1ab9e8f26124dc269d41f00 100644 (file)
@@ -1470,6 +1470,10 @@ static void net_shaper_flush(struct net_shaper_binding *binding)
 
        xa_for_each(&hierarchy->shapers, index, cur) {
                xa_erase(&hierarchy->shapers, index);
+               /* No need to use kfree_rcu(), netdev is already unpublished,
+                * and synchronize_rcu() has been run as part of
+                * unregister_netdevice().
+                */
                kfree(cur);
        }