--- a/drivers/infiniband/core/restrack.c +++ b/drivers/infiniband/core/restrack.c @@ -234,6 +234,7 @@ static void rdma_restrack_add(struct rdm } else { ret = xa_alloc_cyclic(&rt->xa, &res->id, res, xa_limit_32b, &rt->next_id, GFP_KERNEL); + ret = (ret < 0) ? ret : 0; } if (!ret)