RDMA/mlx5: Fix potential race between destroy and CQE poll
authorLeon Romanovsky <leonro@mellanox.com>
Sun, 30 Aug 2020 08:40:04 +0000 (11:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:57:47 +0000 (09:57 +0100)
commitb8d4f65c6ae2fa9fd5fced741d143b030a492cc7
tree606d35805f9562398c8a42d1fac76ff072dbd90f
parent935950e3190d864e54029638536bf86922038ee3
RDMA/mlx5: Fix potential race between destroy and CQE poll

[ Upstream commit 4b916ed9f9e85f705213ca8d69771d3c1cd6ee5a ]

The SRQ can be destroyed right before mlx5_cmd_get_srq is called.
In such case the latter will return NULL instead of expected SRQ.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Link: https://lore.kernel.org/r/20200830084010.102381-5-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/cq.c