diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2019-10-28 16:36:29 -0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-10-28 16:36:29 -0300 |
commit | 036313316d3a38bfde9ba49b3d00f73b7d8019d2 (patch) | |
tree | 284127b68e10bd919adb420a5f37dc19d06532f6 /drivers/infiniband/core/device.c | |
parent | a52dc3a100958f4bf5e921067ba626c2caf8e55f (diff) | |
parent | d6d5df1db6e9d7f8f76d2911707f7d5877251b02 (diff) | |
download | blackbird-op-linux-036313316d3a38bfde9ba49b3d00f73b7d8019d2.tar.gz blackbird-op-linux-036313316d3a38bfde9ba49b3d00f73b7d8019d2.zip |
Merge tag 'v5.4-rc5' into rdma.git for-next
Linux 5.4-rc5
For dependencies in the next patches
Conflict resolved by keeping the delete of the unlock.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r-- | drivers/infiniband/core/device.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index a93c23867fb5..f8d383ceae05 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -1998,8 +1998,6 @@ static int iw_query_port(struct ib_device *device, if (!netdev) return -ENODEV; - dev_put(netdev); - port_attr->max_mtu = IB_MTU_4096; port_attr->active_mtu = ib_mtu_int_to_enum(netdev->mtu); @@ -2007,19 +2005,22 @@ static int iw_query_port(struct ib_device *device, port_attr->state = IB_PORT_DOWN; port_attr->phys_state = IB_PORT_PHYS_STATE_DISABLED; } else { - inetdev = in_dev_get(netdev); + rcu_read_lock(); + inetdev = __in_dev_get_rcu(netdev); if (inetdev && inetdev->ifa_list) { port_attr->state = IB_PORT_ACTIVE; port_attr->phys_state = IB_PORT_PHYS_STATE_LINK_UP; - in_dev_put(inetdev); } else { port_attr->state = IB_PORT_INIT; port_attr->phys_state = IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING; } + + rcu_read_unlock(); } + dev_put(netdev); err = device->ops.query_port(device, port_num, port_attr); if (err) return err; |