net/mlx5: Fix vport QoS cleanup on error
When enabling vport QoS fails, the scheduling node was never freed,
causing a leak.
Add the missing free and reset the vport scheduling node pointer to
NULL.
Fixes: be034baba8
("net/mlx5: Make vport QoS enablement more flexible for future extensions")
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250225072608.526866-2-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
2d253726ff
commit
7f3528f7d2
1 changed files with 4 additions and 1 deletions
|
@ -591,8 +591,11 @@ static int mlx5_esw_qos_vport_enable(struct mlx5_vport *vport, enum sched_node_t
|
|||
sched_node->vport = vport;
|
||||
vport->qos.sched_node = sched_node;
|
||||
err = esw_qos_vport_enable(vport, parent, extack);
|
||||
if (err)
|
||||
if (err) {
|
||||
__esw_qos_free_node(sched_node);
|
||||
esw_qos_put(esw);
|
||||
vport->qos.sched_node = NULL;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue