]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/mlx5: Fix prefetch memory leak if get_prefetchable_mr fails
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 27 Jul 2020 09:57:12 +0000 (12:57 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 27 Jul 2020 14:50:20 +0000 (11:50 -0300)
commitba2af0f768784a79139749f37773dc99553ad482
treea7fca9b130689e77a13168c5aacf2f426f5a2ab6
parentbbc67daadda6d4dcc0e250a6c1ec47a1ad557fe1
RDMA/mlx5: Fix prefetch memory leak if get_prefetchable_mr fails

destroy_prefetch_work() must always be called if the work is not going
to be queued. The num_sge also should have been set to i, not i-1
which avoids the condition where it shouldn't have been called in the
first place.

Cc: stable@vger.kernel.org
Fixes: 305d1d7ac95b ("RDMA/mlx5: Use SRCU properly in ODP prefetch")
Link: https://lore.kernel.org/r/20200727095712.495652-1-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/odp.c