]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: SD, Keep multi-pf debugfs entries on primary
authorShay Drory <shayd@nvidia.com>
Mon, 4 May 2026 18:02:04 +0000 (21:02 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 May 2026 02:13:09 +0000 (19:13 -0700)
commit05217e4ffbb229e7218cf318e0033780abadb624
treed8156e1856a93d6c83466be84d9a3acd924e06d3
parent3abcedfdfd3125431ed404fa75724118beac630b
net/mlx5: SD, Keep multi-pf debugfs entries on primary

mlx5_sd_init() creates the "multi-pf" debugfs directory under the
primary device debugfs root, but stored the dentry in the calling
device's sd struct. When sd_cleanup() run on a different PF,
this leads to using the wrong sd->dfs for removing entries, which
results in memory leak and an error in when re-creating the SD.[1]

Fix it by explicitly storing the debugfs dentry in the primary
device sd struct and use it for all per-group files.

[1]
debugfs: 'multi-pf' already exists in '0000:08:00.1'

Fixes: 4375130bf527 ("net/mlx5: SD, Add debugfs")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260504180206.268568-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c