summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-01-09 15:58:56 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-01-22 11:39:50 -0700
commit66c74d746db127152fadb33f75b2a8ffa4a02b27 (patch)
tree966e903e03a9ab33f87d59abdaed88331b73c793 /drivers
parent2493a57bc10f4f67d241711b058e42c0b0f1b31a (diff)
downloadlinux-66c74d746db127152fadb33f75b2a8ffa4a02b27.tar.gz
RDMA/cma: Update cma_validate_port to honor net namespace
cma_validate_port uses rdma_dev_addr to validate the port of the cm_id.
It needs to honor the net namespace which is setup during cm_id creation
when finding netdevice.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/cma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 575ee4676252..2784512f597f 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -628,7 +628,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
 		return ret;
 
 	if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) {
-		ndev = dev_get_by_index(&init_net, bound_if_index);
+		ndev = dev_get_by_index(dev_addr->net, bound_if_index);
 		if (!ndev)
 			return ret;
 	} else {