]> Git Repo - J-linux.git/commitdiff
rpcrdma: Always release the rpcrdma_device's xa_array
authorChuck Lever <[email protected]>
Wed, 30 Oct 2024 20:11:30 +0000 (16:11 -0400)
committerChuck Lever <[email protected]>
Wed, 30 Oct 2024 20:14:00 +0000 (16:14 -0400)
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.

Reported-by: Dai Ngo <[email protected]>
Fixes: 7e86845a0346 ("rpcrdma: Implement generic device removal")
Signed-off-by: Chuck Lever <[email protected]>
net/sunrpc/xprtrdma/ib_client.c

index 8507cd4d892170dcaf166056e4013aa821c1fcee..28c68b5f682382ea2906e6c56db0793b313a5efc 100644 (file)
@@ -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);
 }
 
This page took 0.046469 seconds and 4 git commands to generate.