RDMA/uverbs: Fix the check for port number
[pandora-kernel.git] / drivers / infiniband / core / uverbs_cmd.c
index a5a7f47..465ac94 100644 (file)
@@ -1790,7 +1790,8 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file,
                goto out;
        }
 
                goto out;
        }
 
-       if (!rdma_is_port_valid(qp->device, cmd.port_num)) {
+       if ((cmd.attr_mask & IB_QP_PORT) &&
+           !rdma_is_port_valid(qp->device, cmd.port_num)) {
                ret = -EINVAL;
                goto release_qp;
        }
                ret = -EINVAL;
                goto release_qp;
        }