Unverified Commit 60f6c2a0 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8686 mlxsw: spectrum_acl_tcam: Fix memory leak during rehash

parents 1c1cfbaa 3aa92f78
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1243,6 +1243,8 @@ mlxsw_sp_acl_tcam_vchunk_migrate_start(struct mlxsw_sp *mlxsw_sp,
{
	struct mlxsw_sp_acl_tcam_chunk *new_chunk;

	WARN_ON(vchunk->chunk2);

	new_chunk = mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, region);
	if (IS_ERR(new_chunk))
		return PTR_ERR(new_chunk);
@@ -1387,6 +1389,8 @@ mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *mlxsw_sp,
	err = mlxsw_sp_acl_tcam_vchunk_migrate_all(mlxsw_sp, vregion,
						   ctx, credits);
	if (err) {
		if (ctx->this_is_rollback)
			return err;
		/* In case migration was not successful, we need to swap
		 * so the original region pointer is assigned again
		 * to vregion->region.