Thread (21 messages) 21 messages, 6 authors, 2021-04-13
STALE1903d REVIEWED: 1 (0M)

[PATCH for-rc 2/4] IB/hfi1: Call xa_destroy before unloading the module

From: dennis.dalessandro@cornelisnetworks.com
Date: 2021-03-29 13:51:25
Also in: stable
Subsystem: infiniband subsystem, the rest · Maintainers: Jason Gunthorpe, Leon Romanovsky, Linus Torvalds

From: Kaike Wan <redacted>

Call xa_destroy for hfi1_dev_table before unloading the module to avoid
a potential memory leak.

Fixes: 03b92789e5cf ("hfi1: Convert hfi1_unit_table to XArray")
Cc: <redacted>
Reviewed-by: Mike Marciniszyn <redacted>
Signed-off-by: Kaike Wan <redacted>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
---
 drivers/infiniband/hw/hfi1/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c
index 93237bf..e4f8db4 100644
--- a/drivers/infiniband/hw/hfi1/init.c
+++ b/drivers/infiniband/hw/hfi1/init.c
@@ -1507,7 +1507,7 @@ static void __exit hfi1_mod_cleanup(void)
 	node_affinity_destroy_all();
 	hfi1_dbg_exit();
 
-	WARN_ON(!xa_empty(&hfi1_dev_table));
+	xa_destroy(&hfi1_dev_table);
 	dispose_firmware();	/* asymmetric with obtain_firmware() */
 	dev_cleanup();
 }
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help