Commit d3552fb6 authored by Jason Gunthorpe's avatar Jason Gunthorpe

RDMA/cm: Remove return code from add_cm_id_to_port_list

This cannot happen, all callers pass in one of the two pointers. Use
a WARN_ON guard instead.

Link: https://lore.kernel.org/r/20200506074701.9775-3-leon@kernel.orgSigned-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent f8f2a576
...@@ -474,24 +474,19 @@ static int cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc, ...@@ -474,24 +474,19 @@ static int cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc,
grh, &av->ah_attr); grh, &av->ah_attr);
} }
static int add_cm_id_to_port_list(struct cm_id_private *cm_id_priv, static void add_cm_id_to_port_list(struct cm_id_private *cm_id_priv,
struct cm_av *av, struct cm_av *av, struct cm_port *port)
struct cm_port *port)
{ {
unsigned long flags; unsigned long flags;
int ret = 0;
spin_lock_irqsave(&cm.lock, flags); spin_lock_irqsave(&cm.lock, flags);
if (&cm_id_priv->av == av) if (&cm_id_priv->av == av)
list_add_tail(&cm_id_priv->prim_list, &port->cm_priv_prim_list); list_add_tail(&cm_id_priv->prim_list, &port->cm_priv_prim_list);
else if (&cm_id_priv->alt_av == av) else if (&cm_id_priv->alt_av == av)
list_add_tail(&cm_id_priv->altr_list, &port->cm_priv_altr_list); list_add_tail(&cm_id_priv->altr_list, &port->cm_priv_altr_list);
else else
ret = -EINVAL; WARN_ON(true);
spin_unlock_irqrestore(&cm.lock, flags); spin_unlock_irqrestore(&cm.lock, flags);
return ret;
} }
static struct cm_port * static struct cm_port *
...@@ -572,12 +567,7 @@ static int cm_init_av_by_path(struct sa_path_rec *path, ...@@ -572,12 +567,7 @@ static int cm_init_av_by_path(struct sa_path_rec *path,
return ret; return ret;
av->timeout = path->packet_life_time + 1; av->timeout = path->packet_life_time + 1;
add_cm_id_to_port_list(cm_id_priv, av, port);
ret = add_cm_id_to_port_list(cm_id_priv, av, port);
if (ret) {
rdma_destroy_ah_attr(&new_ah_attr);
return ret;
}
rdma_move_ah_attr(&av->ah_attr, &new_ah_attr); rdma_move_ah_attr(&av->ah_attr, &new_ah_attr);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment