mlxsw: spectrum: Fix error path in mlxsw_sp_module_init()
authorJiri Pirko <jiri@mellanox.com>
Wed, 31 Jul 2019 06:33:14 +0000 (09:33 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Jul 2019 15:22:12 +0000 (08:22 -0700)
In case of sp2 pci driver registration fail, fix the error path to
start with sp1 pci driver unregister.

Fixes: c3ab435466d5 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index 6506381..eda9c23 100644 (file)
@@ -6330,7 +6330,7 @@ static int __init mlxsw_sp_module_init(void)
        return 0;
 
 err_sp2_pci_driver_register:
-       mlxsw_pci_driver_unregister(&mlxsw_sp2_pci_driver);
+       mlxsw_pci_driver_unregister(&mlxsw_sp1_pci_driver);
 err_sp1_pci_driver_register:
        mlxsw_core_driver_unregister(&mlxsw_sp2_driver);
 err_sp2_core_driver_register: