mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
RDMA/mlx5: Fix ucaps init error flow
In mlx5_ib_stage_caps_init(), if mlx5_ib_init_ucaps() fails after
mlx5_ib_init_var_table() succeeds, the VAR bitmap is leaked since
the function returns without cleanup.
Thus, cleanup the var table bitmap in case of error of initializing
ucaps before exiting, preventing the leak above.
Fixes: cf7174e898 ("RDMA/mlx5: Create UCAP char devices for supported device capabilities")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260104-ib-core-misc-v1-3-00367f77f3a8@nvidia.com
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
8d466b155f
commit
6dc78c53de
|
|
@ -4598,12 +4598,16 @@ static int mlx5_ib_stage_caps_init(struct mlx5_ib_dev *dev)
|
|||
MLX5_HCA_CAP_2_GENERAL_OBJECT_TYPES_RDMA_CTRL) {
|
||||
err = mlx5_ib_init_ucaps(dev);
|
||||
if (err)
|
||||
return err;
|
||||
goto err_ucaps;
|
||||
}
|
||||
|
||||
dev->ib_dev.use_cq_dim = true;
|
||||
|
||||
return 0;
|
||||
|
||||
err_ucaps:
|
||||
bitmap_free(dev->var_table.bitmap);
|
||||
return err;
|
||||
}
|
||||
|
||||
static const struct ib_device_ops mlx5_ib_dev_port_ops = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user