]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: shaper: drop unnecessary kfree_rcu in pre_insert
authorJakub Kicinski <kuba@kernel.org>
Tue, 9 Jun 2026 18:32:22 +0000 (11:32 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 11 Jun 2026 10:55:23 +0000 (12:55 +0200)
If we fail to insert a node into the XArray in net_shaper_pre_insert()
we can free it directly - it was never visible to the RCU readers.

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

index a5b42b697a9327a512900d9d620b5d3ff4bcfb22..33958462e5e99c02316b7e7cf6fca6740167e56d 100644 (file)
@@ -406,7 +406,7 @@ static int net_shaper_pre_insert(struct net_shaper_binding *binding,
        prev = xa_store(&hierarchy->shapers, index, cur, GFP_KERNEL);
        if (xa_err(prev)) {
                NL_SET_ERR_MSG(extack, "Can't insert shaper into device store");
-               kfree_rcu(cur, rcu);
+               kfree(cur);
                ret = xa_err(prev);
                goto free_id;
        }