RDMA/cm: Read id.state under lock when doing pr_debug()
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 10 Mar 2020 09:25:36 +0000 (11:25 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 17 Mar 2020 20:05:52 +0000 (17:05 -0300)
commit153a2e432e3d323b633155633429dcaf71ea7c53
tree45d0dbaff3822de61c76f741482c64ae88395a2e
parent98f67156a80f37db70ec64787020b1f9bc8aea8c
RDMA/cm: Read id.state under lock when doing pr_debug()

The lock should not be dropped before doing the pr_debug() print as it is
accessing data protected by the lock, such as id.state.

Fixes: 119bf81793ea ("IB/cm: Add debug prints to ib_cm")
Link: https://lore.kernel.org/r/20200310092545.251365-7-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cm.c