Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56411
b: refs/heads/master
c: 6c719f5
h: refs/heads/master
i:
  56409: 73ad1fe
  56407: 6c9dcd9
v: v3
  • Loading branch information
Sean Hefty authored and Roland Dreier committed May 14, 2007
1 parent 5205f9c commit f93be30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be65f086f2a50c478b2f5ecf4c55a52a4e95059a
refs/heads/master: 6c719f5c6c823901fac2d46b83db5a69ba7e9152
12 changes: 8 additions & 4 deletions trunk/drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ static void cma_enable_remove(struct rdma_id_private *id_priv)
wake_up(&id_priv->wait_remove);
}

static int cma_has_cm_dev(struct rdma_id_private *id_priv)
{
return (id_priv->id.device && id_priv->cm_id.ib);
}

struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
void *context, enum rdma_port_space ps)
{
Expand Down Expand Up @@ -2422,7 +2427,7 @@ int rdma_notify(struct rdma_cm_id *id, enum ib_event_type event)
int ret;

id_priv = container_of(id, struct rdma_id_private, id);
if (!cma_comp(id_priv, CMA_CONNECT))
if (!cma_has_cm_dev(id_priv))
return -EINVAL;

switch (id->device->node_type) {
Expand All @@ -2444,7 +2449,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data,
int ret;

id_priv = container_of(id, struct rdma_id_private, id);
if (!cma_comp(id_priv, CMA_CONNECT))
if (!cma_has_cm_dev(id_priv))
return -EINVAL;

switch (rdma_node_get_transport(id->device->node_type)) {
Expand Down Expand Up @@ -2475,8 +2480,7 @@ int rdma_disconnect(struct rdma_cm_id *id)
int ret;

id_priv = container_of(id, struct rdma_id_private, id);
if (!cma_comp(id_priv, CMA_CONNECT) &&
!cma_comp(id_priv, CMA_DISCONNECT))
if (!cma_has_cm_dev(id_priv))
return -EINVAL;

switch (rdma_node_get_transport(id->device->node_type)) {
Expand Down

0 comments on commit f93be30

Please sign in to comment.