提交 1cbe866c 编写于 作者: M Mohamad Heib 提交者: Jason Gunthorpe

IB/core: Fix wrong iterating on ports

rdma_for_each_port is already incrementing the iterator's value it
receives therefore, after the first iteration the iterator is increased by
2 which eventually causing wrong queries and possible traces.

Fix the above by removing the old redundant incrementation that was used
before rdma_for_each_port() macro.

Cc: <stable@vger.kernel.org>
Fixes: ea1075ed ("RDMA: Add and use rdma_for_each_port")
Link: https://lore.kernel.org/r/20191002122127.17571-1-leon@kernel.orgSigned-off-by: NMohamad Heib <mohamadh@mellanox.com>
Reviewed-by: NErez Alfasi <ereza@mellanox.com>
Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: NJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 594e6c5d
...@@ -426,7 +426,7 @@ int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev) ...@@ -426,7 +426,7 @@ int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev)
int ret; int ret;
rdma_for_each_port (dev, i) { rdma_for_each_port (dev, i) {
is_ib = rdma_protocol_ib(dev, i++); is_ib = rdma_protocol_ib(dev, i);
if (is_ib) if (is_ib)
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册