summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2018-10-11 22:36:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-13 11:08:32 -0800
commit9f7a37efdf32f7d13d2151826a4f6198b45fe848 (patch)
tree4eed84e1beacbbc02d260194a434f03c88e09575
parentbc280cf5299d619feff74fd03f8e4ef3345c251f (diff)
downloadlinux-stable-9f7a37efdf32f7d13d2151826a4f6198b45fe848.tar.gz
linux-stable-9f7a37efdf32f7d13d2151826a4f6198b45fe848.tar.bz2
linux-stable-9f7a37efdf32f7d13d2151826a4f6198b45fe848.zip
RDMA/cm: Respect returned status of cm_init_av_by_path
[ Upstream commit e54b6a3bcd1ec972b25a164bdf495d9e7120b107 ] Add missing check for failure of cm_init_av_by_path Fixes: e1444b5a163e ("IB/cm: Fix automatic path migration support") Reported-by: Slava Shwartsman <slavash@mellanox.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/infiniband/core/cm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 6e39c27dca8e..4c533275d1f2 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3292,8 +3292,11 @@ static int cm_lap_handler(struct cm_work *work)
if (ret)
goto unlock;
- cm_init_av_by_path(param->alternate_path, NULL, &cm_id_priv->alt_av,
- cm_id_priv);
+ ret = cm_init_av_by_path(param->alternate_path, NULL,
+ &cm_id_priv->alt_av, cm_id_priv);
+ if (ret)
+ goto unlock;
+
cm_id_priv->id.lap_state = IB_CM_LAP_RCVD;
cm_id_priv->tid = lap_msg->hdr.tid;
ret = atomic_inc_and_test(&cm_id_priv->work_count);