Skip to content

Commit aeb6601

Browse files
zhengchaoshaoSaeed Mahameed
authored and
Saeed Mahameed
committed
net/mlx5e: fix double free in macsec_fs_tx_create_crypto_table_groups
In function macsec_fs_tx_create_crypto_table_groups(), when the ft->g memory is successfully allocated but the 'in' memory fails to be allocated, the memory pointed to by ft->g is released once. And in function macsec_fs_tx_create(), macsec_fs_tx_destroy() is called to release the memory pointed to by ft->g again. This will cause double free problem. Fixes: e467b28 ("net/mlx5e: Add MACsec TX steering rules") Signed-off-by: Zhengchao Shao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent fa29d46 commit aeb6601

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

1 file changed

+1
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ static int macsec_fs_tx_create_crypto_table_groups(struct mlx5e_flow_table *ft)
161161

162162
if (!in) {
163163
kfree(ft->g);
164+
ft->g = NULL;
164165
return -ENOMEM;
165166
}
166167

0 commit comments

Comments
 (0)