]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: Fix use after free in mlx5e_fs_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 4 Aug 2022 14:43:21 +0000 (17:43 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 22 Aug 2022 19:57:10 +0000 (12:57 -0700)
Call mlx5e_fs_vlan_free(fs) before kvfree(fs).

Fixes: 03cf2b2b7493 ("net/mlx5e: Convert mlx5e_flow_steering member of mlx5e_priv to pointer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c

index e2a9b9be5c1fba84499005133feb14e7dc133258..e0ce5a233d0b4a46358e07527df4639e896c0bdb 100644 (file)
@@ -1395,10 +1395,11 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
        }
 
        return fs;
-err_free_fs:
-       kvfree(fs);
+
 err_free_vlan:
        mlx5e_fs_vlan_free(fs);
+err_free_fs:
+       kvfree(fs);
 err:
        return NULL;
 }