Skip to content

Commit de48aad

Browse files
chuckleveramschuma-ntap
authored andcommitted
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 <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 47ac09b commit de48aad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/xprtrdma/ib_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ int rpcrdma_rn_register(struct ib_device *device,
6262
if (!rd || test_bit(RPCRDMA_RD_F_REMOVING, &rd->rd_flags))
6363
return -ENETUNREACH;
6464

65-
kref_get(&rd->rd_kref);
6665
if (xa_alloc(&rd->rd_xa, &rn->rn_index, rn, xa_limit_32b, GFP_KERNEL) < 0)
6766
return -ENOMEM;
67+
kref_get(&rd->rd_kref);
6868
rn->rn_done = done;
6969
return 0;
7070
}

0 commit comments

Comments
 (0)