Skip to content

Commit 7f3528f

Browse files
cjubrankuba-moo
authored andcommitted
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: be034ba ("net/mlx5: Make vport QoS enablement more flexible for future extensions") Signed-off-by: Carolina Jubran <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2d25372 commit 7f3528f

File tree

1 file changed

+4
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/esw

1 file changed

+4
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,11 @@ static int mlx5_esw_qos_vport_enable(struct mlx5_vport *vport, enum sched_node_t
591591
sched_node->vport = vport;
592592
vport->qos.sched_node = sched_node;
593593
err = esw_qos_vport_enable(vport, parent, extack);
594-
if (err)
594+
if (err) {
595+
__esw_qos_free_node(sched_node);
595596
esw_qos_put(esw);
597+
vport->qos.sched_node = NULL;
598+
}
596599

597600
return err;
598601
}

0 commit comments

Comments
 (0)