summaryrefslogtreecommitdiff
path: root/tools/lib/python/feat
diff options
context:
space:
mode:
authorWentao Liang <vulab@iscas.ac.cn>2026-06-09 11:47:30 +0300
committerJakub Kicinski <kuba@kernel.org>2026-06-12 01:49:33 +0300
commit21cf8dc478a49e8de039c2739b1646a774cb1944 (patch)
tree40f3579efffaa13f1fcfcf170e6bef81e03591ef /tools/lib/python/feat
parent41c8c1d65b32beacd8d916a22457b4f6e47f45af (diff)
downloadlinux-21cf8dc478a49e8de039c2739b1646a774cb1944.tar.xz
mlxsw: fix refcount leak in mlxsw_sp_vrs_lpm_tree_replace()
When mlxsw_sp_vrs_lpm_tree_replace() fails after replacing some VRs, the error rollback loop does not correctly revert the preceding replacements. The loop decrements the index but fails to update the vr pointer, which still points to the VR that caused the failure. As a result, the condition and the rollback call always operate on the same VR, potentially calling mlxsw_sp_vr_lpm_tree_replace() multiple times on it while never rolling back the earlier VRs. Those VRs continue to hold a reference to new_tree acquired via mlxsw_sp_lpm_tree_hold(), leaking the reference count of new_tree. Fix by reinitializing vr inside the error loop with the updated index: vr = &mlxsw_sp->router->vrs[i]; so that the loop correctly iterates over all VRs that were actually replaced. Cc: stable@vger.kernel.org Fixes: fc922bb0dd94 ("mlxsw: spectrum_router: Use one LPM tree for all virtual routers") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260609084730.215732-1-vulab@iscas.ac.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/lib/python/feat')
0 files changed, 0 insertions, 0 deletions