net/mlx5e: Fix MACsec SA initialization routine
authorEmeel Hakim <ehakim@nvidia.com>
Sun, 30 Oct 2022 09:43:24 +0000 (11:43 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 22 Nov 2022 02:14:35 +0000 (18:14 -0800)
commitd20a56b0eb006096a023a59efccb27a277b38344
tree5d4cf245ffb4fe7727de50a0f9d3db01240edd4c
parent11abca031ee34d8d50876e899cb2875d8fac01df
net/mlx5e: Fix MACsec SA initialization routine

Currently as part of MACsec SA initialization routine
extended packet number (EPN) object attribute is always
being set without checking if EPN is actually enabled,
the above could lead to a NULL dereference.
Fix by adding such a check.

Fixes: 4411a6c0abd3 ("net/mlx5e: Support MACsec offload extended packet number (EPN)")
Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
Reviewed-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c