net/mlx5: Don't skip subfunction cleanup in case of error in module init
Clean SF resources if mlx5 eth failed to initialize. Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver") Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
d09c548dbf
commit
c633e79964
@ -1784,16 +1784,14 @@ static int __init init(void)
|
||||
if (err)
|
||||
goto err_sf;
|
||||
|
||||
#ifdef CONFIG_MLX5_CORE_EN
|
||||
err = mlx5e_init();
|
||||
if (err) {
|
||||
pci_unregister_driver(&mlx5_core_driver);
|
||||
goto err_debug;
|
||||
}
|
||||
#endif
|
||||
if (err)
|
||||
goto err_en;
|
||||
|
||||
return 0;
|
||||
|
||||
err_en:
|
||||
mlx5_sf_driver_unregister();
|
||||
err_sf:
|
||||
pci_unregister_driver(&mlx5_core_driver);
|
||||
err_debug:
|
||||
@ -1803,9 +1801,7 @@ err_debug:
|
||||
|
||||
static void __exit cleanup(void)
|
||||
{
|
||||
#ifdef CONFIG_MLX5_CORE_EN
|
||||
mlx5e_cleanup();
|
||||
#endif
|
||||
mlx5_sf_driver_unregister();
|
||||
pci_unregister_driver(&mlx5_core_driver);
|
||||
mlx5_unregister_debugfs();
|
||||
|
@ -206,8 +206,13 @@ int mlx5_firmware_flash(struct mlx5_core_dev *dev, const struct firmware *fw,
|
||||
int mlx5_fw_version_query(struct mlx5_core_dev *dev,
|
||||
u32 *running_ver, u32 *stored_ver);
|
||||
|
||||
#ifdef CONFIG_MLX5_CORE_EN
|
||||
int mlx5e_init(void);
|
||||
void mlx5e_cleanup(void);
|
||||
#else
|
||||
static inline int mlx5e_init(void){ return 0; }
|
||||
static inline void mlx5e_cleanup(void){}
|
||||
#endif
|
||||
|
||||
static inline bool mlx5_sriov_is_enabled(struct mlx5_core_dev *dev)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user