summaryrefslogtreecommitdiff
path: root/net/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2024-08-12 18:47:57 +0300
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2024-08-19 18:50:41 +0300
commitde48aad2a8e80ba026ca91c383f590f0bf97b3c0 (patch)
tree9c6596afb3ff2f346618ccc0c2d99104478c2e1e /net/sunrpc
parent47ac09b91befbb6a235ab620c32af719f8208399 (diff)
downloadlinux-de48aad2a8e80ba026ca91c383f590f0bf97b3c0.tar.xz
rpcrdma: Device kref is over-incremented on error from xa_alloc
If the device's reference count is too high, the device completion callback never fires. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/ib_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/xprtrdma/ib_client.c b/net/sunrpc/xprtrdma/ib_client.c
index a938c19c3490..4d1e9fa89573 100644
--- a/net/sunrpc/xprtrdma/ib_client.c
+++ b/net/sunrpc/xprtrdma/ib_client.c
@@ -62,9 +62,9 @@ int rpcrdma_rn_register(struct ib_device *device,
if (!rd || test_bit(RPCRDMA_RD_F_REMOVING, &rd->rd_flags))
return -ENETUNREACH;
- kref_get(&rd->rd_kref);
if (xa_alloc(&rd->rd_xa, &rn->rn_index, rn, xa_limit_32b, GFP_KERNEL) < 0)
return -ENOMEM;
+ kref_get(&rd->rd_kref);
rn->rn_done = done;
return 0;
}