Skip to contentSkip to conversation

rpcrdma: Always release the rpcrdma_device's xa_array

PATCH New [email protected] 1 participant 1 message Oct 30, 2024

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 rpcrdma: Always release the rpcrdma_device's xa_array

From: Chuck Lever <[email protected]>

Dai pointed out that the xa_init_flags() in rpcrdma_add_one() needs to have a matching xa_destroy() in rpcrdma_remove_one() to release underlying memory that the xarray might have accrued during operation.

Fixes 7e86845a0346 ("rpcrdma: Implement generic device removal")
---
 net/sunrpc/xprtrdma/ib_client.c | 1 +
 1 file changed, 1 insertion(+)
net/sunrpc/xprtrdma/ib_client.c +1 -0
index 8507cd4d8921..28c68b5f6823 100644
@@ -153,6 +153,7 @@ static void rpcrdma_remove_one(struct ib_device *device,
 	}
 
 	trace_rpcrdma_client_remove_one_done(device);
+	xa_destroy(&rd->rd_xa);
 	kfree(rd);
 }
 
Signature · 1 line
2.47.0