Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] infiniband: cxgb4: Add cleanup on failure path in c4iw_init_module()
@ 2026-11-21  9:00 Wanhui Fu
  2026-11-21  9:05 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Wanhui Fu @ 2026-11-21  9:00 UTC (permalink / raw)
  To: bharat, jgg, leon; +Cc: linux-rdma, Wanhui Fu

Add c4iw_cm_term() and debugfs_remove_recursive() if reg_workq is
not allocated successfully to release memory.

Signed-off-by: Wanhui Fu <fuwh1120@163.com>
---
 drivers/infiniband/hw/cxgb4/device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 24ac9871ce67..e337494e30ff 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -1548,6 +1548,8 @@ static int __init c4iw_init_module(void)
 	reg_workq = create_singlethread_workqueue("Register_iWARP_device");
 	if (!reg_workq) {
 		pr_err("Failed creating workqueue to register iwarp device\n");
+		debugfs_remove_recursive(c4iw_debugfs_root);
+		c4iw_cm_term();
 		return -ENOMEM;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-21  9:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21  9:00 [PATCH] infiniband: cxgb4: Add cleanup on failure path in c4iw_init_module() Wanhui Fu
2026-11-21  9:05 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox