]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/core: Fix locking in ib_uverbs_event_read
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 8 Jan 2020 17:22:03 +0000 (19:22 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 10 Jan 2020 14:52:56 +0000 (10:52 -0400)
commit1cd60c92ee41e3313403897ecaaface28d7b76fa
tree943acf256671a2ff0075fced9959db471f090be3
parent372fbe6d352b2340a92e882195a86abbc268107b
RDMA/core: Fix locking in ib_uverbs_event_read

This should not be using ib_dev to test for disassociation, during
disassociation is_closed is set under lock and the waitq is triggered.

Instead check is_closed and be sure to re-obtain the lock to test the
value after the wait_event returns.

Fixes: dbb7309013ea ("IB/uverbs: Enable device removal when there are active user space applications")
Link: https://lore.kernel.org/r/1578504126-9400-12-git-send-email-yishaih@mellanox.com
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_main.c