diff options
author | Parvi Kaustubhi <pkaustub@cisco.com> | 2018-12-11 23:15:42 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-12-20 00:30:16 +0100 |
commit | 8036e90f92aae2784b855a0007ae2d8154d28b3c (patch) | |
tree | 9318314659953114da77ef2f3739ef0ff4c7a28b /arch/nds32 | |
parent | RDMA/bnxt_re: Make use of destroy AH sleepable flag (diff) | |
download | linux-8036e90f92aae2784b855a0007ae2d8154d28b3c.tar.xz linux-8036e90f92aae2784b855a0007ae2d8154d28b3c.zip |
IB/usnic: Fix potential deadlock
Acquiring the rtnl lock while holding usdev_lock could result in a
deadlock.
For example:
usnic_ib_query_port()
| mutex_lock(&us_ibdev->usdev_lock)
| ib_get_eth_speed()
| rtnl_lock()
rtnl_lock()
| usnic_ib_netdevice_event()
| mutex_lock(&us_ibdev->usdev_lock)
This commit moves the usdev_lock acquisition after the rtnl lock has been
released.
This is safe to do because usdev_lock is not protecting anything being
accessed in ib_get_eth_speed(). Hence, the correct order of holding locks
(rtnl -> usdev_lock) is not violated.
Signed-off-by: Parvi Kaustubhi <pkaustub@cisco.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'arch/nds32')
0 files changed, 0 insertions, 0 deletions