diff options
author | Parav Pandit <parav@mellanox.com> | 2017-11-14 15:52:14 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2017-12-19 01:37:11 +0300 |
commit | 5cf3968afcc752fa2db6910e9694120b3373c73b (patch) | |
tree | 270b87d6b045ab887575d3dec5d70c7b5e7a2572 /drivers/infiniband/core/cm.c | |
parent | 0c4386ec77cfcd0ccbdbe8c2e67dd3a49b2a4c7f (diff) | |
download | linux-5cf3968afcc752fa2db6910e9694120b3373c73b.tar.xz |
IB/cm: Handle address handle attribute init error
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>
Diffstat (limited to 'drivers/infiniband/core/cm.c')
-rw-r--r-- | drivers/infiniband/core/cm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index f9bb24c2679e..c6a816678675 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -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); |