diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-06-29 15:03:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-01 01:57:34 +0300 |
commit | 09ef193fef7efb0175a04634853862d717adbb95 (patch) | |
tree | 1e0d25ac25590865d99c057a46cff296356fafd1 | |
parent | e0cdac65ba269767d5531cc40ab7fe858e2650d9 (diff) | |
download | linux-09ef193fef7efb0175a04634853862d717adbb95.tar.xz |
net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()
This function may fail. Check its return value and propagate the error
code.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 254486e6b09d..fabdca9aadae 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -11173,10 +11173,14 @@ skip_sriov: IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL, true); - ixgbe_mii_bus_init(hw); + err = ixgbe_mii_bus_init(hw); + if (err) + goto err_netdev; return 0; +err_netdev: + unregister_netdev(netdev); err_register: ixgbe_release_hw_control(adapter); ixgbe_clear_interrupt_scheme(adapter); |