]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Allocate flow steering storage during uplink initialization
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 16 Aug 2022 08:47:23 +0000 (11:47 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 04:59:03 +0000 (21:59 -0700)
commit108e94cd1d1941cd3dc8842cd5cf5ab27302f3b1
treeee5b782c43645022ca27b1b15f4486ebc6687b03
parent7c2cac84d75ed0e0d1037df82d99c63283623c62
net/mlx5e: Allocate flow steering storage during uplink initialization

IPsec code relies on valid priv->fs pointer that is the case in NIC
flow, but not correct in uplink. Before commit that mentioned in the
Fixes line, that pointer was valid in all flows as it was allocated
together with priv struct.

In addition, the cleanup representors routine called to that
not-initialized priv->fs pointer and its internals which caused NULL
deference.

So, move FS allocation to be as early as possible.

Fixes: ddca8c225319 ("net/mlx5e: Convert mlx5e_flow_steering member of mlx5e_priv to pointer")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/ae46fa5bed3c67f937bfdfc0370101278f5422f1.1660639564.git.leonro@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c