summaryrefslogtreecommitdiff
path: root/drivers/infiniband/sw/siw
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-07-11 11:29:42 -0300
committerJason Gunthorpe <jgg@mellanox.com>2019-07-11 11:29:42 -0300
commitc421651fa2295d1219c36674c7eb8c574542ceea (patch)
treec261298922a54940661793525abac19fe27d1f28 /drivers/infiniband/sw/siw
parent775a41e281cf08b1d9e0f2dd89c062430b289a10 (diff)
RDMA/siw: Add missing rtnl_lock around access to ifa
ifa is protected by rcu or rtnl, add the missing locking. In this case we have to use rtnl since siw_listen_address() is sleeping. Fixes: 6c52fdc244b5 ("rdma/siw: connection management") Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/sw/siw')
-rw-r--r--drivers/infiniband/sw/siw/siw_cm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index 8e618cb7261f..c25be723c15b 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -1975,6 +1975,7 @@ int siw_create_listen(struct iw_cm_id *id, int backlog)
id, &s_laddr.sin_addr, ntohs(s_laddr.sin_port),
&s_raddr->sin_addr, ntohs(s_raddr->sin_port));
+ rtnl_lock();
for_ifa(in_dev)
{
if (ipv4_is_zeronet(s_laddr.sin_addr.s_addr) ||
@@ -1989,6 +1990,7 @@ int siw_create_listen(struct iw_cm_id *id, int backlog)
}
}
endfor_ifa(in_dev);
+ rtnl_unlock();
in_dev_put(in_dev);
} else if (id->local_addr.ss_family == AF_INET6) {
struct inet6_dev *in6_dev = in6_dev_get(dev);