]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix a use after free on error in mlx5_tc_ct_shared_counter_get()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 28 Sep 2020 09:05:56 +0000 (12:05 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 1 Oct 2020 04:26:31 +0000 (21:26 -0700)
commit96d12a3d6f669eba3ed676f59c366749ec706593
tree07c23a164bd254de4eac8b0fb1949d36651ac761
parentfa8b8f3add0d52ed3a05b4a52c061ede0b2346e5
net/mlx5e: Fix a use after free on error in mlx5_tc_ct_shared_counter_get()

This code frees "shared_counter" and then dereferences on the next line
to get the error code.

Fixes: da404640cb59 ("net/mlx5e: CT: Use the same counter for both directions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c