OSDN Git Service

RDMA/mlx5: Fix async events cleanup flows
authorYishai Hadas <yishaih@mellanox.com>
Wed, 12 Feb 2020 07:26:32 +0000 (09:26 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 13 Feb 2020 13:48:17 +0000 (09:48 -0400)
commita8af8694a5e8ddaaef4bd7b6426c12b7759c846c
tree695a280aa57708cedd68bdd77c8f5255a85e096a
parenta0767da7774d91a668f9c223cec3e76172cd833b
RDMA/mlx5: Fix async events cleanup flows

As in the prior patch, the devx code is not fully cleaning up its
event_lists before finishing driver_destroy allowing a later read to
trigger user after free conditions.

Re-arrange things so that the event_list is always empty after destroy and
ensure it remains empty until the file is closed.

Fixes: f7c8416ccea5 ("RDMA/core: Simplify destruction of FD uobjects")
Link: https://lore.kernel.org/r/20200212072635.682689-7-leon@kernel.org
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/devx.c