RDMA/mlx5: Fix unwind flow as part of mlx5_ib_stage_init_init
authorYishai Hadas <yishaih@nvidia.com>
Tue, 28 May 2024 12:52:55 +0000 (15:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jun 2024 11:49:10 +0000 (13:49 +0200)
[ Upstream commit 81497c148b7a2e4a4fbda93aee585439f7323e2e ]

Fix unwind flow as part of mlx5_ib_stage_init_init to use the correct
goto upon an error.

Fixes: 758ce14aee82 ("RDMA/mlx5: Implement MACsec gid addition and deletion")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
Link: https://lore.kernel.org/r/aa40615116eda14ec9eca21d52017d632ea89188.1716900410.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/main.c

index 102ead497196c87bf978397c7a3e4b448072a82b..45a497c0258b30f71e2ee27891579d873a275485 100644 (file)
@@ -3732,10 +3732,10 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev)
        spin_lock_init(&dev->dm.lock);
        dev->dm.dev = mdev;
        return 0;
-err:
-       mlx5r_macsec_dealloc_gids(dev);
 err_mp:
        mlx5_ib_cleanup_multiport_master(dev);
+err:
+       mlx5r_macsec_dealloc_gids(dev);
        return err;
 }