Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69811496 authored by Moni Shoua's avatar Moni Shoua Committed by Leon Romanovsky
Browse files

net/mlx5: Release resource on error flow



Fix reference counting leakage when the event handler aborts due to an
unsupported event for the resource type.

Fixes: a14c2d4b ("net/mlx5_core: Warn on unsupported events of QP/RQ/SQ")
Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
Reviewed-by: default avatarMajd Dibbiny <majd@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent c74d90c1
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -132,7 +132,7 @@ void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type)
	if (!is_event_type_allowed((rsn >> MLX5_USER_INDEX_LEN), event_type)) {
	if (!is_event_type_allowed((rsn >> MLX5_USER_INDEX_LEN), event_type)) {
		mlx5_core_warn(dev, "event 0x%.2x is not allowed on resource 0x%.8x\n",
		mlx5_core_warn(dev, "event 0x%.2x is not allowed on resource 0x%.8x\n",
			       event_type, rsn);
			       event_type, rsn);
		return;
		goto out;
	}
	}


	switch (common->res) {
	switch (common->res) {
@@ -150,7 +150,7 @@ void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type)
	default:
	default:
		mlx5_core_warn(dev, "invalid resource type for 0x%x\n", rsn);
		mlx5_core_warn(dev, "invalid resource type for 0x%x\n", rsn);
	}
	}

out:
	mlx5_core_put_rsc(common);
	mlx5_core_put_rsc(common);
}
}