Skip to content

Commit

Permalink
rpcrdma: Always release the rpcrdma_device's xa_array
Browse files Browse the repository at this point in the history
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 <dai.ngo@oracle.com>
Fixes: 7e86845 ("rpcrdma: Implement generic device removal")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Chuck Lever committed Oct 30, 2024
1 parent 8286f8b commit 63a8158
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/sunrpc/xprtrdma/ib_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 63a8158

Please sign in to comment.