2020-06-29 19:15:53

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v2 01/10] net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()

From: Bartosz Golaszewski <[email protected]>

This function may fail. Check its return value and propagate the error
code.

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 97a423ecf808..8752b5eea091 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -11175,10 +11175,14 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
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);
--
2.26.1


2020-06-29 19:29:41

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()



On 6/29/2020 5:03 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> This function may fail. Check its return value and propagate the error
> code.
>
> Signed-off-by: Bartosz Golaszewski <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian

2020-06-29 20:27:41

by Jeff Kirsher

[permalink] [raw]
Subject: RE: [PATCH v2 01/10] net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()

> -----Original Message-----
> From: Bartosz Golaszewski <[email protected]>
> Sent: Monday, June 29, 2020 05:04
> To: Kirsher, Jeffrey T <[email protected]>; David S . Miller
> <[email protected]>; Jakub Kicinski <[email protected]>; John Crispin
> <[email protected]>; Sean Wang <[email protected]>; Mark Lee
> <[email protected]>; Matthias Brugger
> <[email protected]>; Heiner Kallweit <[email protected]>; Andrew
> Lunn <[email protected]>; Florian Fainelli <[email protected]>; Russell King
> <[email protected]>; Rob Herring <[email protected]>; Frank Rowand
> <[email protected]>
> Cc: [email protected]; [email protected]; linux-arm-
> [email protected]; [email protected];
> [email protected]; Bartosz Golaszewski
> <[email protected]>
> Subject: [PATCH v2 01/10] net: ethernet: ixgbe: check the return value of
> ixgbe_mii_bus_init()
>
> From: Bartosz Golaszewski <[email protected]>
>
> This function may fail. Check its return value and propagate the error code.
>
> Signed-off-by: Bartosz Golaszewski <[email protected]>

Acked-by: Jeff Kirsher <[email protected]>

> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)