Skip to content

Commit

Permalink
IB/core: Fix wrong iterating on ports
Browse files Browse the repository at this point in the history
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: <[email protected]>
Fixes: ea1075e ("RDMA: Add and use rdma_for_each_port")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mohamad Heib <[email protected]>
Reviewed-by: Erez Alfasi <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
Mohamad Heib authored and jgunthorpe committed Oct 4, 2019
1 parent 594e6c5 commit 1cbe866
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1cbe866

Please sign in to comment.