Commit 3c114fb2 authored by Carolina Jubran's avatar Carolina Jubran Committed by Jakub Kicinski
Browse files

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: be034bab ("net/mlx5: Make vport QoS enablement more flexible for future extensions")
Signed-off-by: default avatarCarolina Jubran <cjubran@nvidia.com>
Reviewed-by: default avatarCosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: default avatarMark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250820133209.389065-6-mbloch@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b697ef4d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1109,8 +1109,10 @@ static int mlx5_esw_qos_vport_enable(struct mlx5_vport *vport, enum sched_node_t

	parent_esw = parent ? parent->esw : esw;
	sched_node = __esw_qos_alloc_node(parent_esw, 0, type, parent);
	if (!sched_node)
	if (!sched_node) {
		esw_qos_put(esw);
		return -ENOMEM;
	}
	if (!parent)
		list_add_tail(&sched_node->entry, &esw->qos.domain->nodes);