i40iw: Do an RCU lookup in i40iw_add_ipv4_addr
authorShiraz Saleem <shiraz.saleem@intel.com>
Tue, 4 Feb 2020 22:38:40 +0000 (16:38 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 11 Feb 2020 18:31:11 +0000 (14:31 -0400)
commit9a4b24108d92ffaa886e37923088bd806b988948
tree5777aec1303d8f6294df925fdb48a1d8537bbb76
parentd7e2d3432ae7795e5b77a77039e904ed4a769f39
i40iw: Do an RCU lookup in i40iw_add_ipv4_addr

The in_dev_for_each_ifa_rtnl() iterator in i40iw_add_ipv4_addr requires
that the rtnl lock be held. But the rtnl_trylock/unlock scheme in this
function does not guarantee it.

Replace the rtnl locking with an RCU lookup using
in_dev_for_each_ifa_rcu()

Fixes: 8e06af711bf2 ("i40iw: add main, hdr, status")
Link: https://lore.kernel.org/r/20200204223840.2151-1-shiraz.saleem@intel.com
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_main.c