RDMA/core: Initialize port_num in qp_attr
authorIsmail, Mustafa <mustafa.ismail@intel.com>
Fri, 14 Jul 2017 14:41:31 +0000 (09:41 -0500)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Jul 2017 15:24:13 +0000 (11:24 -0400)
Initialize the port_num for iWARP in rdma_init_qp_attr.

Fixes: 5ecce4c9b17b("Check port number supplied by user verbs cmds")
Cc: <stable@vger.kernel.org> # v2.6.14+
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Tested-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cma.c

index 11aff923b633f9eb5329993dab8e5db445d31aa8..0eb393237ba2fc74e486d2880f3c6d71d50ccced 100644 (file)
@@ -1033,6 +1033,8 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
                } else
                        ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr,
                                                 qp_attr_mask);
+               qp_attr->port_num = id_priv->id.port_num;
+               *qp_attr_mask |= IB_QP_PORT;
        } else
                ret = -ENOSYS;