Skip to content

Commit

Permalink
IB/cm: Handle address handle attribute init error
Browse files Browse the repository at this point in the history
cm_init_av_by_path depends on ib_init_ah_from_path to initialize ah
attribute and ib_init_ah_from_path() can fail, such error should not
be ignored.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Parav Pandit authored and Jason Gunthorpe committed Dec 18, 2017
1 parent 0c4386e commit 5cf3968
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/infiniband/core/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,11 @@ static int cm_init_av_by_path(struct sa_path_rec *path, struct cm_av *av,
return ret;

av->port = port;
ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path,
&av->ah_attr);
ret = ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path,
&av->ah_attr);
if (ret)
return ret;

av->timeout = path->packet_life_time + 1;

spin_lock_irqsave(&cm.lock, flags);
Expand Down

0 comments on commit 5cf3968

Please sign in to comment.