Return-Path: Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:52926 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbdKVWYF (ORCPT ); Wed, 22 Nov 2017 17:24:05 -0500 From: alexander.levin@verizon.com Cc: Thomas Preisner , Milan Stephan , "David S . Miller" , alexander.levin@verizon.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.9 13/56] net: 3com: typhoon: typhoon_init_one: make return values more specific Date: Wed, 22 Nov 2017 22:23:30 +0000 Message-ID: <20171122222246.19618-26-alexander.levin@verizon.com> References: <20171122222246.19618-1-alexander.levin@verizon.com> In-Reply-To: <20171122222246.19618-1-alexander.levin@verizon.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Thomas Preisner [ Upstream commit 6b6bbb5922a4b1d4b58125a572da91010295fba3 ] In some cases the return value of a failing function is not being used and the function typhoon_init_one() returns another negative error code instead. Signed-off-by: Thomas Preisner Signed-off-by: Milan Stephan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/3com/typhoon.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3co= m/typhoon.c index 8f8418d2ac4a..6d0f0eb2ee2f 100644 --- a/drivers/net/ethernet/3com/typhoon.c +++ b/drivers/net/ethernet/3com/typhoon.c @@ -2366,9 +2366,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct p= ci_device_id *ent) * 4) Get the hardware address. * 5) Put the card to sleep. */ - if (typhoon_reset(ioaddr, WaitSleep) < 0) { + err =3D typhoon_reset(ioaddr, WaitSleep); + if (err < 0) { err_msg =3D "could not reset 3XP"; - err =3D -EIO; goto error_out_dma; } =20 @@ -2382,16 +2382,16 @@ typhoon_init_one(struct pci_dev *pdev, const struct= pci_device_id *ent) typhoon_init_interface(tp); typhoon_init_rings(tp); =20 - if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) { + err =3D typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST); + if (err < 0) { err_msg =3D "cannot boot 3XP sleep image"; - err =3D -EIO; goto error_out_reset; } =20 INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_MAC_ADDRESS); - if(typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp) < 0) { + err =3D typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp); + if (err < 0) { err_msg =3D "cannot read MAC address"; - err =3D -EIO; goto error_out_reset; } =20 @@ -2424,9 +2424,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct p= ci_device_id *ent) if(xp_resp[0].numDesc !=3D 0) tp->capabilities |=3D TYPHOON_WAKEUP_NEEDS_RESET; =20 - if(typhoon_sleep(tp, PCI_D3hot, 0) < 0) { + err =3D typhoon_sleep(tp, PCI_D3hot, 0); + if (err < 0) { err_msg =3D "cannot put adapter to sleep"; - err =3D -EIO; goto error_out_reset; } =20 --=20 2.11.0