]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: IPsec, fix memory leak at mlx5_fpga_ipsec_delete_sa_ctx
authorRaed Salem <raeds@mellanox.com>
Wed, 23 Oct 2019 13:41:21 +0000 (16:41 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 6 Feb 2020 20:24:23 +0000 (12:24 -0800)
commitb1f6c27bd57d21ef043097246c3e6cefc5adad67
treec7be1008597f27ab33640029eb13654cb04febfc
parent27b7376889361bcc70c5a65c7249e808423ce251
net/mlx5: IPsec, fix memory leak at mlx5_fpga_ipsec_delete_sa_ctx

SA context is allocated at mlx5_fpga_ipsec_create_sa_ctx,
however the counterpart mlx5_fpga_ipsec_delete_sa_ctx function
nullifies sa_ctx pointer without freeing the memory allocated,
hence the memory leak.

Fix by free SA context when the SA is released.

Fixes: c14d4cc22df2 ("net/mlx5: Refactor accel IPSec code")
Signed-off-by: Raed Salem <raeds@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c