[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220930114335.608894-1-praghadeeshthevendria@gmail.com>
Date: Fri, 30 Sep 2022 17:13:35 +0530
From: Praghadeesh T K S <praghadeeshthevendria@...il.com>
To: Boris Pismenny <borisp@...dia.com>,
Saeed Mahameed <saeedm@...dia.com>,
Leon Romanovsky <leon@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
"GitAuthor: Praghadeesh" <praghadeeshthevendria@...il.com>,
netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: praghadeeshtks@...omail.in,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: [PATCH] net: ethernet/mellanox: fix dereference before null check
net: ethernet/mellanox: fix dereference before null check
macsec dereferenced before null check
bug identified by coverity's linux-next weekly scan
Coverity CID No: 1525317
Signed-off-by: Praghadeesh T K S <praghadeeshthevendria@...il.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
index 5da746d..e822c2a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
@@ -1846,11 +1846,11 @@ int mlx5e_macsec_init(struct mlx5e_priv *priv)
void mlx5e_macsec_cleanup(struct mlx5e_priv *priv)
{
struct mlx5e_macsec *macsec = priv->macsec;
- struct mlx5_core_dev *mdev = macsec->mdev;
if (!macsec)
return;
+ struct mlx5_core_dev *mdev = macsec->mdev;
mlx5_notifier_unregister(mdev, &macsec->nb);
mlx5e_macsec_fs_cleanup(macsec->macsec_fs);
--
2.25.1
Powered by blists - more mailing lists