linux/drivers/infiniband/hw/cxgb4
Fan Wu fe5c16bb62 RDMA/cxgb4: Free debugfs on registration failure
c4iw_alloc() creates the per-device debugfs tree (dev->debugfs_root via
setup_debugfs()), but it is removed only in c4iw_remove(), not in
c4iw_dealloc().  When RDMA device registration fails, the registration
worker's err_dealloc_ctx path calls c4iw_dealloc() directly, bypassing
c4iw_remove(), so the debugfs dentries leak and outlive the freed
c4iw_dev.

Move debugfs_remove_recursive() into c4iw_dealloc() so every path that
frees ctx->dev also removes its debugfs tree.

Fixes: 49ea0c036e ("RDMA/iw_cxgb4: cleanup device debugfs entries on ULD remove")
Link: https://patch.msgid.link/r/20260806130128.465460-2-fanwu01@zju.edu.cn
Assisted-by: Codex:gpt-5.6
Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2026-08-11 16:57:33 -03:00
..
cm.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
cq.c RDMA: Replace memset with = {} pattern for ib_respond_udata() 2026-05-18 04:58:42 -04:00
device.c RDMA/cxgb4: Free debugfs on registration failure 2026-08-11 16:57:33 -03:00
ev.c RDMA/iw_cxgb4: Fix refcount underflow while destroying cqs. 2021-08-05 22:33:00 -03:00
id_table.c treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
iw_cxgb4.h IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mem.c RDMA/cxgb4: free STAG index when TPT entry write fails 2026-07-29 07:46:56 -04:00
provider.c RDMA: Use ib_no_udata_io() in query_device callbacks 2026-07-20 09:00:40 -04:00
qp.c RDMA: Replace memset with = {} pattern for ib_respond_udata() 2026-05-18 04:58:42 -04:00
resource.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
restrack.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
t4.h RDMA: Delete not-used static inline functions 2021-03-22 09:31:19 -03:00
t4fw_ri_api.h RDMA/cxgb4: Replace 0-length arrays with flexible arrays 2023-01-15 12:09:26 +02:00