OSDN Git Service

IB/core: Honor return status of ib_init_ah_from_mcmember()
authorParav Pandit <parav@mellanox.com>
Tue, 13 Mar 2018 14:06:13 +0000 (16:06 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 15 Mar 2018 20:40:37 +0000 (14:40 -0600)
The return status of ib_init_ah_from_mcmember() is ignored by
cma_ib_mc_handler().  Honor it and return error event if ah attribute
initialization failed.

Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cma.c

index 4a57869..720ef15 100644 (file)
@@ -3918,10 +3918,14 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)
                        rdma_start_port(id_priv->cma_dev->device)];
 
                event.event = RDMA_CM_EVENT_MULTICAST_JOIN;
-               ib_init_ah_from_mcmember(id_priv->id.device,
-                                        id_priv->id.port_num, &multicast->rec,
-                                        ndev, gid_type,
-                                        &event.param.ud.ah_attr);
+               ret = ib_init_ah_from_mcmember(id_priv->id.device,
+                                              id_priv->id.port_num,
+                                              &multicast->rec,
+                                              ndev, gid_type,
+                                              &event.param.ud.ah_attr);
+               if (ret)
+                       event.event = RDMA_CM_EVENT_MULTICAST_ERROR;
+
                event.param.ud.qp_num = 0xFFFFFF;
                event.param.ud.qkey = be32_to_cpu(multicast->rec.qkey);
                if (ndev)