RDMA/cma: Add cm_id restrack resource based on kernel or user cm_id type
A recent regression causes a null ptr crash when dumping cm_id resources.
The cma is incorrectly adding all cm_id restrack resources as kernel mode.
Fixes: af8d70375d
("RDMA/restrack: Resource-tracker should not use uobject pointers")
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
a9666c1cae
commit
917cb8a72a
|
@ -494,7 +494,10 @@ static void _cma_attach_to_dev(struct rdma_id_private *id_priv,
|
||||||
id_priv->id.route.addr.dev_addr.transport =
|
id_priv->id.route.addr.dev_addr.transport =
|
||||||
rdma_node_get_transport(cma_dev->device->node_type);
|
rdma_node_get_transport(cma_dev->device->node_type);
|
||||||
list_add_tail(&id_priv->list, &cma_dev->id_list);
|
list_add_tail(&id_priv->list, &cma_dev->id_list);
|
||||||
rdma_restrack_kadd(&id_priv->res);
|
if (id_priv->res.kern_name)
|
||||||
|
rdma_restrack_kadd(&id_priv->res);
|
||||||
|
else
|
||||||
|
rdma_restrack_uadd(&id_priv->res);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cma_attach_to_dev(struct rdma_id_private *id_priv,
|
static void cma_attach_to_dev(struct rdma_id_private *id_priv,
|
||||||
|
|
Loading…
Reference in New Issue