]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/mlx5: Re-organize the DM code
authorMaor Gottlieb <maorg@nvidia.com>
Sun, 11 Apr 2021 12:29:21 +0000 (15:29 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 13 Apr 2021 22:36:36 +0000 (19:36 -0300)
commite0c71eca89ed743710621b5705f1da6ef81fba48
tree1c6fdcf6c01ffc052d5ef323afac8a5742d4a233
parent9bf442bdba3d49509529725dfe84014b7b6fc4f0
RDMA/mlx5: Re-organize the DM code

1. Inline the checks from check_dm_type_support() into their
   respective allocation functions.
2. Fix use after free when driver fails to copy the MEMIC address to the
   user by moving the allocation code into their respective functions,
   hence we avoid the explicit call to free the DM in the error flow.
3. Split mlx5_ib_dm struct to memic and icm proper typesafety
   throughout.

Fixes: 1bb6731d02b6 ("IB/mlx5: Fix device memory flows")
Link: https://lore.kernel.org/r/20210411122924.60230-5-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/dm.c
drivers/infiniband/hw/mlx5/dm.h
drivers/infiniband/hw/mlx5/main.c