From: Ismail, Mustafa Date: Fri, 14 Jul 2017 14:41:31 +0000 (-0500) Subject: RDMA/core: Initialize port_num in qp_attr X-Git-Tag: C0P2-H0.0--20200415~8026 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=db29753960904012acfb8958bda5bc53c97f7e56;p=linux.git RDMA/core: Initialize port_num in qp_attr commit a62ab66b13a0f9bcb17b7b761f6670941ed5cd62 upstream. Initialize the port_num for iWARP in rdma_init_qp_attr. Fixes: 5ecce4c9b17b("Check port number supplied by user verbs cmds") Reviewed-by: Steve Wise Signed-off-by: Mustafa Ismail Tested-by: Mike Marciniszyn Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index f2d40c05ef9e..809a02800102 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -976,6 +976,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;