diff options
author | Mark Bloch <markb@mellanox.com> | 2019-03-28 15:27:34 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-04-10 15:05:39 -0300 |
commit | 4a6dc8552ab2f670fdff317a5ac1bc42f85a8772 (patch) | |
tree | d4a467c38228a582a6a97d2bf3efc1e858571fa1 /drivers/infiniband/hw/mlx5/main.c | |
parent | RDMA/mlx5: Move netdev info into the port struct (diff) | |
download | linux-dev-4a6dc8552ab2f670fdff317a5ac1bc42f85a8772.tar.xz linux-dev-4a6dc8552ab2f670fdff317a5ac1bc42f85a8772.zip |
RDMA/mlx5: Free IB device on remove
Simplify the code and move the deallocation of the IB device into the
remove function.
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 315167f36466..23f31069ec0a 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -6417,6 +6417,8 @@ void __mlx5_ib_remove(struct mlx5_ib_dev *dev, if (profile->stage[stage].cleanup) profile->stage[stage].cleanup(dev); } + + ib_dealloc_device(&dev->ib_dev); } void *__mlx5_ib_add(struct mlx5_ib_dev *dev, @@ -6639,8 +6641,6 @@ static void mlx5_ib_remove(struct mlx5_core_dev *mdev, void *context) dev = context; __mlx5_ib_remove(dev, dev->profile, MLX5_IB_STAGE_MAX); - - ib_dealloc_device((struct ib_device *)dev); } static struct mlx5_interface mlx5_ib_interface = { |