linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-rc] IB/core: Fix wrong iterating on ports
@ 2019-10-02 12:21 Leon Romanovsky
  2019-10-04 18:52 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2019-10-02 12:21 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Mohamad Heib, RDMA mailing list, Erez Alfasi, Jason Gunthorpe,
	Leon Romanovsky

From: Mohamad Heib <mohamadh@mellanox.com>

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.

Fixes: ea1075edcbab ("RDMA: Add and use rdma_for_each_port")
Signed-off-by: Mohamad Heib <mohamadh@mellanox.com>
Reviewed-by: Erez Alfasi <ereza@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/core/security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH rdma-rc] IB/core: Fix wrong iterating on ports
  2019-10-02 12:21 [PATCH rdma-rc] IB/core: Fix wrong iterating on ports Leon Romanovsky
@ 2019-10-04 18:52 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2019-10-04 18:52 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Mohamad Heib, RDMA mailing list, Erez Alfasi,
	Leon Romanovsky

On Wed, Oct 02, 2019 at 03:21:27PM +0300, Leon Romanovsky wrote:
> From: Mohamad Heib <mohamadh@mellanox.com>
> 
> 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.
> 
> Fixes: ea1075edcbab ("RDMA: Add and use rdma_for_each_port")
> Signed-off-by: Mohamad Heib <mohamadh@mellanox.com>
> Reviewed-by: Erez Alfasi <ereza@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/core/security.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-04 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 12:21 [PATCH rdma-rc] IB/core: Fix wrong iterating on ports Leon Romanovsky
2019-10-04 18:52 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).