Skip to content

Commit 3c114fb

Browse files
cjubrankuba-moo
authored andcommitted
net/mlx5: Fix QoS reference leak in vport enable error path
Add missing esw_qos_put() call when __esw_qos_alloc_node() fails in mlx5_esw_qos_vport_enable(). 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]> Signed-off-by: Mark Bloch <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b697ef4 commit 3c114fb

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,8 +1109,10 @@ static int mlx5_esw_qos_vport_enable(struct mlx5_vport *vport, enum sched_node_t
11091109

11101110
parent_esw = parent ? parent->esw : esw;
11111111
sched_node = __esw_qos_alloc_node(parent_esw, 0, type, parent);
1112-
if (!sched_node)
1112+
if (!sched_node) {
1113+
esw_qos_put(esw);
11131114
return -ENOMEM;
1115+
}
11141116
if (!parent)
11151117
list_add_tail(&sched_node->entry, &esw->qos.domain->nodes);
11161118

0 commit comments

Comments
 (0)