summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamad Heib <mohamadh@mellanox.com>2019-10-02 15:21:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-17 13:47:21 -0700
commit062876f3772ad881bab914e9cb13401603c34d1c (patch)
tree95d8674bf2cbf0bf2f61e0ce2626ca5d0bca1e87
parentdda012267258f87a5961c2f5b804cbf3bb2b56e4 (diff)
downloadlinux-062876f3772ad881bab914e9cb13401603c34d1c.tar.gz
linux-062876f3772ad881bab914e9cb13401603c34d1c.tar.bz2
linux-062876f3772ad881bab914e9cb13401603c34d1c.zip
IB/core: Fix wrong iterating on ports
commit 1cbe866cbcb53338de33cf67262e73f9315a9725 upstream. 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: ea1075edcbab ("RDMA: Add and use rdma_for_each_port") Link: https://lore.kernel.org/r/20191002122127.17571-1-leon@kernel.org Signed-off-by: Mohamad Heib <mohamadh@mellanox.com> Reviewed-by: Erez Alfasi <ereza@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/infiniband/core/security.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c
index 1ab423b19f77..6eb6d2717ca5 100644
--- a/drivers/infiniband/core/security.c
+++ b/drivers/infiniband/core/security.c
@@ -426,7 +426,7 @@ int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev)
int ret;
rdma_for_each_port (dev, i) {
- is_ib = rdma_protocol_ib(dev, i++);
+ is_ib = rdma_protocol_ib(dev, i);
if (is_ib)
break;
}